PERFORCE change 188380 for review

Edward Tomasz Napierala trasz at FreeBSD.org
Mon Jan 31 16:15:03 UTC 2011


http://p4web.freebsd.org/@@188380?ac=10

Change 188380 by trasz at trasz_victim on 2011/01/31 16:14:22

	Fix build on i386.

Affected files ...

.. //depot/projects/soc2009/trasz_limits/usr.bin/rctl/rctl.c#3 edit

Differences ...

==== //depot/projects/soc2009/trasz_limits/usr.bin/rctl/rctl.c#3 (text+ko) ====

@@ -42,6 +42,7 @@
 #include <grp.h>
 #include <libutil.h>
 #include <pwd.h>
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -143,7 +144,7 @@
 static char *
 expand_amount(char *rule)
 {
-	int64_t num;
+	uint64_t num;
 	const char *subject, *subject_id, *resource, *action, *amount, *per;
 	char *copy, *expanded;
 
@@ -172,9 +173,9 @@
 		err(1, "expand_number");
 
 	if (per == NULL)
-		asprintf(&expanded, "%s:%s:%s:%s=%ld", subject, subject_id, resource, action, num);
+		asprintf(&expanded, "%s:%s:%s:%s=%ju", subject, subject_id, resource, action, (uintmax_t)num);
 	else
-		asprintf(&expanded, "%s:%s:%s:%s=%ld/%s", subject, subject_id, resource, action, num, per);
+		asprintf(&expanded, "%s:%s:%s:%s=%ju/%s", subject, subject_id, resource, action, (uintmax_t)num, per);
 
 	if (expanded == NULL)
 		err(1, "asprintf");


More information about the p4-projects mailing list