summaryrefslogtreecommitdiffstats
path: root/bin/pax/sel_subs.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/pax/sel_subs.c')
-rw-r--r--bin/pax/sel_subs.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/bin/pax/sel_subs.c b/bin/pax/sel_subs.c
index ba7b71e..7a8a98b 100644
--- a/bin/pax/sel_subs.c
+++ b/bin/pax/sel_subs.c
@@ -78,7 +78,7 @@ static GRPT **grptb = NULL; /* group selection table */
* 0 if this archive member should be processed, 1 if it should be skipped
*/
-#if __STDC__
+#ifdef __STDC__
int
sel_chk(register ARCHD *arcn)
#else
@@ -109,7 +109,7 @@ sel_chk(arcn)
* 0 if added ok, -1 otherwise;
*/
-#if __STDC__
+#ifdef __STDC__
int
usr_add(register char *str)
#else
@@ -130,7 +130,7 @@ usr_add(str)
return(-1);
if ((usrtb == NULL) &&
((usrtb = (USRT **)calloc(USR_TB_SZ, sizeof(USRT *))) == NULL)) {
- pax_warn(1, "Unable to allocate memory for user selection table");
+ paxwarn(1, "Unable to allocate memory for user selection table");
return(-1);
}
@@ -144,7 +144,7 @@ usr_add(str)
if ((str[0] == '\\') && (str[1] == '#'))
++str;
if ((pw = getpwnam(str)) == NULL) {
- pax_warn(1, "Unable to find uid for user: %s", str);
+ paxwarn(1, "Unable to find uid for user: %s", str);
return(-1);
}
uid = (uid_t)pw->pw_uid;
@@ -152,7 +152,7 @@ usr_add(str)
# ifdef NET2_STAT
uid = (uid_t)atoi(str+1);
# else
- uid = (uid_t)strtoul(str+1, (char **)NULL, 10);
+ uid = (uid_t)strtoul(str+1, NULL, 10);
# endif
endpwent();
@@ -177,7 +177,7 @@ usr_add(str)
usrtb[indx] = pt;
return(0);
}
- pax_warn(1, "User selection table out of memory");
+ paxwarn(1, "User selection table out of memory");
return(-1);
}
@@ -188,7 +188,7 @@ usr_add(str)
* 0 if this archive member should be processed, 1 if it should be skipped
*/
-#if __STDC__
+#ifdef __STDC__
static int
usr_match(register ARCHD *arcn)
#else
@@ -222,7 +222,7 @@ usr_match(arcn)
* 0 if added ok, -1 otherwise;
*/
-#if __STDC__
+#ifdef __STDC__
int
grp_add(register char *str)
#else
@@ -243,7 +243,7 @@ grp_add(str)
return(-1);
if ((grptb == NULL) &&
((grptb = (GRPT **)calloc(GRP_TB_SZ, sizeof(GRPT *))) == NULL)) {
- pax_warn(1, "Unable to allocate memory fo group selection table");
+ paxwarn(1, "Unable to allocate memory fo group selection table");
return(-1);
}
@@ -257,7 +257,7 @@ grp_add(str)
if ((str[0] == '\\') && (str[1] == '#'))
++str;
if ((gr = getgrnam(str)) == NULL) {
- pax_warn(1,"Cannot determine gid for group name: %s", str);
+ paxwarn(1,"Cannot determine gid for group name: %s", str);
return(-1);
}
gid = (gid_t)gr->gr_gid;
@@ -265,7 +265,7 @@ grp_add(str)
# ifdef NET2_STAT
gid = (gid_t)atoi(str+1);
# else
- gid = (gid_t)strtoul(str+1, (char **)NULL, 10);
+ gid = (gid_t)strtoul(str+1, NULL, 10);
# endif
endgrent();
@@ -290,7 +290,7 @@ grp_add(str)
grptb[indx] = pt;
return(0);
}
- pax_warn(1, "Group selection table out of memory");
+ paxwarn(1, "Group selection table out of memory");
return(-1);
}
@@ -301,7 +301,7 @@ grp_add(str)
* 0 if this archive member should be processed, 1 if it should be skipped
*/
-#if __STDC__
+#ifdef __STDC__
static int
grp_match(register ARCHD *arcn)
#else
@@ -357,7 +357,7 @@ grp_match(arcn)
* 0 if the time range was added to the list, -1 otherwise
*/
-#if __STDC__
+#ifdef __STDC__
int
trng_add(register char *str)
#else
@@ -376,14 +376,14 @@ trng_add(str)
* throw out the badly formed time ranges
*/
if ((str == NULL) || (*str == '\0')) {
- pax_warn(1, "Empty time range string");
+ paxwarn(1, "Empty time range string");
return(-1);
}
/*
* locate optional flags suffix /{cm}.
*/
- if ((flgpt = rindex(str, '/')) != NULL)
+ if ((flgpt = strrchr(str, '/')) != NULL)
*flgpt++ = '\0';
for (stpt = str; *stpt != '\0'; ++stpt) {
@@ -403,7 +403,7 @@ trng_add(str)
++dot;
continue;
}
- pax_warn(1, "Improperly specified time range: %s", str);
+ paxwarn(1, "Improperly specified time range: %s", str);
goto out;
}
@@ -411,7 +411,7 @@ trng_add(str)
* allocate space for the time range and store the limits
*/
if ((pt = (TIME_RNG *)malloc(sizeof(TIME_RNG))) == NULL) {
- pax_warn(1, "Unable to allocate memory for time range");
+ paxwarn(1, "Unable to allocate memory for time range");
return(-1);
}
@@ -434,7 +434,7 @@ trng_add(str)
pt->flgs |= CMPCTME;
break;
default:
- pax_warn(1, "Bad option %c with time range %s",
+ paxwarn(1, "Bad option %c with time range %s",
*flgpt, str);
goto out;
}
@@ -445,13 +445,13 @@ trng_add(str)
/*
* start off with the current time
*/
- pt->low_time = pt->high_time = time((time_t *)NULL);
+ pt->low_time = pt->high_time = time(NULL);
if (*str != '\0') {
/*
* add lower limit
*/
if (str_sec(str, &(pt->low_time)) < 0) {
- pax_warn(1, "Illegal lower time range %s", str);
+ paxwarn(1, "Illegal lower time range %s", str);
(void)free((char *)pt);
goto out;
}
@@ -463,7 +463,7 @@ trng_add(str)
* add upper limit
*/
if (str_sec(up_pt, &(pt->high_time)) < 0) {
- pax_warn(1, "Illegal upper time range %s", up_pt);
+ paxwarn(1, "Illegal upper time range %s", up_pt);
(void)free((char *)pt);
goto out;
}
@@ -474,7 +474,7 @@ trng_add(str)
*/
if (pt->flgs & HASLOW) {
if (pt->low_time > pt->high_time) {
- pax_warn(1, "Upper %s and lower %s time overlap",
+ paxwarn(1, "Upper %s and lower %s time overlap",
up_pt, str);
(void)free((char *)pt);
return(-1);
@@ -492,7 +492,7 @@ trng_add(str)
return(0);
out:
- pax_warn(1, "Time range format is: [yy[mm[dd[hh]]]]mm[.ss][/[c][m]]");
+ paxwarn(1, "Time range format is: [yy[mm[dd[hh]]]]mm[.ss][/[c][m]]");
return(-1);
}
@@ -503,7 +503,7 @@ trng_add(str)
* 0 if this archive member should be processed, 1 if it should be skipped
*/
-#if __STDC__
+#ifdef __STDC__
static int
trng_match(register ARCHD *arcn)
#else
@@ -578,7 +578,7 @@ trng_match(arcn)
* 0 if converted ok, -1 otherwise
*/
-#if __STDC__
+#ifdef __STDC__
static int
str_sec(register char *str, time_t *tval)
#else
@@ -592,7 +592,7 @@ str_sec(str, tval)
register char *dot = NULL;
lt = localtime(tval);
- if ((dot = index(str, '.')) != NULL) {
+ if ((dot = strchr(str, '.')) != NULL) {
/*
* seconds (.ss)
*/
OpenPOWER on IntegriCloud