summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2010-01-04 15:40:17 +0000
committerkib <kib@FreeBSD.org>2010-01-04 15:40:17 +0000
commitd061de008ac2d14466eefecb47b69b59e5e79408 (patch)
treeb365b59af8b0b68bad0041e490012bdb8c25eace /usr.sbin
parent16db58ba54bd23cade57dc720cf9bd57f5487f3e (diff)
downloadFreeBSD-src-d061de008ac2d14466eefecb47b69b59e5e79408.zip
FreeBSD-src-d061de008ac2d14466eefecb47b69b59e5e79408.tar.gz
Modernize scandir(3) and alphasort(3) interfaces according to the IEEE
Std 1003.1-2008. Both Linux and Solaris conforms to the new definitions, so we better follow too (older glibc used old BSDish alphasort prototype and corresponding type of the comparision function for scandir). While there, change the definitions of the functions to ANSI C and fix several style issues nearby. Remove requirement for "sys/types.h" include for functions from manpage. POSIX also requires that alphasort(3) sorts as if strcoll(3) was used, but leave the strcmp(3) call in the function for now. Adapt in-tree callers of scandir(3) to new declaration. The fact that select_sections() from catman(1) could modify supplied struct dirent is a bug. PR: standards/142255 MFC after: 2 weeks
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/lpr/common_source/lp.h2
-rw-r--r--usr.sbin/lpr/common_source/rmjob.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/lpr/common_source/lp.h b/usr.sbin/lpr/common_source/lp.h
index 891ed2f..63f2ff1 100644
--- a/usr.sbin/lpr/common_source/lp.h
+++ b/usr.sbin/lpr/common_source/lp.h
@@ -280,7 +280,7 @@ void inform(const struct printer *_pp, char *_cf);
void init_printer(struct printer *_pp);
void init_request(struct request *_rp);
int inlist(char *_uname, char *_cfile);
-int iscf(struct dirent *_d);
+int iscf(const struct dirent *_d);
void ldump(const char *_nfile, const char *_datafile, int _copies);
void lastprinter(void);
int lockchk(struct printer *_pp, char *_slockf);
diff --git a/usr.sbin/lpr/common_source/rmjob.c b/usr.sbin/lpr/common_source/rmjob.c
index d6fd614..33fcdac 100644
--- a/usr.sbin/lpr/common_source/rmjob.c
+++ b/usr.sbin/lpr/common_source/rmjob.c
@@ -384,7 +384,7 @@ rmremote(const struct printer *pp)
* Return 1 if the filename begins with 'cf'
*/
int
-iscf(struct dirent *d)
+iscf(const struct dirent *d)
{
return(d->d_name[0] == 'c' && d->d_name[1] == 'f');
}
OpenPOWER on IntegriCloud