summaryrefslogtreecommitdiff
path: root/loginutils/addgroup.c
diff options
context:
space:
mode:
authorRob Landley2006-08-03 15:41:12 +0000
committerRob Landley2006-08-03 15:41:12 +0000
commitd921b2ecc0d294ad4bf8c7458fc52a60c28727d2 (patch)
treee4a2769349867c441cf2983d83097bb66701a733 /loginutils/addgroup.c
parent6dce0b6fa79f2d4bb7e9d90e1fbc0f6beb25f855 (diff)
downloadbusybox-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.zip
busybox-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.gz
Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only had one user), clean up lots of #includes... General cleanup pass. What I've been doing for the last couple days. And it conflicts! I've removed httpd.c from this checkin due to somebody else touching that file. It builds for me. I have to catch a bus. (Now you know why I'm looking forward to Mercurial.)
Diffstat (limited to 'loginutils/addgroup.c')
-rw-r--r--loginutils/addgroup.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/loginutils/addgroup.c b/loginutils/addgroup.c
index f4962ff..f5a99b7 100644
--- a/loginutils/addgroup.c
+++ b/loginutils/addgroup.c
@@ -9,11 +9,6 @@
*
*/
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <unistd.h>
-
#include "busybox.h"
/* make sure gr_name isn't taken, make sure gid is kosher
@@ -26,7 +21,7 @@ static int group_study(struct group *g)
struct group *grp;
const int max = 65000;
- etc_group = bb_xfopen(bb_path_group_file, "r");
+ etc_group = xfopen(bb_path_group_file, "r");
/* make sure gr_name isn't taken, make sure gid is kosher */
desired = g->gr_gid;
@@ -67,13 +62,13 @@ static int addgroup(char *group, gid_t gid, const char *user)
return 1;
/* add entry to group */
- file = bb_xfopen(bb_path_group_file, "a");
+ file = xfopen(bb_path_group_file, "a");
/* group:passwd:gid:userlist */
fprintf(file, "%s:%s:%d:%s\n", group, "x", gr.gr_gid, user);
fclose(file);
#if ENABLE_FEATURE_SHADOWPASSWDS
- file = bb_xfopen(bb_path_gshadow_file, "a");
+ file = xfopen(bb_path_gshadow_file, "a");
fprintf(file, "%s:!::\n", group);
fclose(file);
#endif