PERFORCE change 166742 for review
Edward Tomasz Napierala
trasz at FreeBSD.org
Wed Jul 29 18:55:25 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=166742
Change 166742 by trasz at trasz_victim on 2009/07/29 18:54:48
Signal overflow by ERANGE, not EFBIG.
Affected files ...
.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_hrl.c#33 edit
.. //depot/projects/soc2009/trasz_limits/usr.sbin/hrl/hrl.c#18 edit
Differences ...
==== //depot/projects/soc2009/trasz_limits/sys/kern/kern_hrl.c#33 (text+ko) ====
@@ -1157,7 +1157,7 @@
sbuf_finish(outputsbuf);
if (outbuflen < sbuf_len(outputsbuf) + 1) {
sbuf_delete(outputsbuf);
- return (EFBIG); /* ERANGE? */
+ return (ERANGE);
}
error = copyout(sbuf_data(outputsbuf), outbufp, sbuf_len(outputsbuf) + 1);
sbuf_delete(outputsbuf);
==== //depot/projects/soc2009/trasz_limits/usr.sbin/hrl/hrl.c#18 (text+ko) ====
@@ -40,42 +40,6 @@
#define BUFLEN_DEFAULT 1024
-#if 0
-static void
-print_subject(int subject, id_t id)
-{
-
- switch (subject) {
- case HRL_SUBJECT_PROCESS:
- printf("process:%u", (unsigned int)id);
- break;
- case HRL_SUBJECT_USER:
- pwd = getpwuid(id);
- if (pwd != NULL)
- printf("user:%s", pwd->pw_name);
- else
- printf("user:%u", (unsigned int)id);
- break;
- case HRL_SUBJECT_GROUP:
- grp = getgrgid(id);
- if (grp != NULL)
- printf("group:%s", grp->gr_name);
- else
- printf("group:%u", (unsigned int)id);
- break;
- case HRL_SUBJECT_LOGINCLASS:
- printf("class:%u", (unsigned int)id);
- break;
- case HRL_SUBJECT_JAIL:
- printf("jail:%u", (unsigned int)id);
- break;
- default:
- printf("undefined<0x%x>:%u", subject, (unsigned int)id);
- break;
- }
-}
-#endif
-
static id_t
parse_user(const char *s)
{
@@ -226,9 +190,9 @@
err(1, "realloc");
error = hrl_get_limits(filter, strlen(filter) + 1, outbuf, outbuflen);
- if (error && errno != EFBIG)
+ if (error && errno != ERANGE)
err(1, "hrl_get_limits");
- } while (error && errno == EFBIG);
+ } while (error && errno == ERANGE);
printf("Resource utilisation:\n");
print_rules(outbuf);
@@ -264,9 +228,9 @@
err(1, "realloc");
error = hrl_get_usage(filter, strlen(filter) + 1, outbuf, outbuflen);
- if (error && errno != EFBIG)
+ if (error && errno != ERANGE)
err(1, "hrl_get_usage");
- } while (error && errno == EFBIG);
+ } while (error && errno == ERANGE);
for (tmp = outbuf; *tmp != '\0'; tmp++)
if (*tmp == ',')
@@ -299,9 +263,9 @@
err(1, "realloc");
error = hrl_get_rules(filter, filterlen, outbuf, outbuflen);
- if (error && errno != EFBIG)
+ if (error && errno != ERANGE)
err(1, "hrl_get_rules");
- } while (error && errno == EFBIG);
+ } while (error && errno == ERANGE);
printf("Defined resource limits:\n");
print_rules(outbuf);
More information about the p4-projects
mailing list