OSDN Git Service

Usischev Yury pointed out that id shouldn't use exit() directly.
[android-x86/external-toybox.git] / toys / posix / id.c
index aa43072..4b732b1 100644 (file)
@@ -73,7 +73,7 @@ static void s_or_u(char *s, unsigned u, int done)
   else printf("%u", u);
   if (done) {
     xputc('\n');
-    exit(0);
+    xexit();
   }
 }
 
@@ -82,7 +82,7 @@ static void showid(char *header, unsigned u, char *s)
   printf("%s%u(%s)", header, u, s);
 }
 
-void do_id(char *username)
+static void do_id(char *username)
 {
   int flags, i, ngroups;
   struct passwd *pw;
@@ -143,7 +143,7 @@ void do_id(char *username)
     }
     if (toys.optflags&FLAG_G) {
       xputc('\n');
-      exit(0);
+      xexit();
     }
   }