summaryrefslogtreecommitdiff
path: root/utility.c
diff options
context:
space:
mode:
authorEric Andersen2000-07-14 06:49:52 +0000
committerEric Andersen2000-07-14 06:49:52 +0000
commitfad04fdd12604a46eff62875343515c33e1863c6 (patch)
tree7b840eb074878c454141ce76ba7328f4a8621f1b /utility.c
parentb870af09ae1892ab84dd089529675cc2df533e71 (diff)
downloadbusybox-fad04fdd12604a46eff62875343515c33e1863c6.zip
busybox-fad04fdd12604a46eff62875343515c33e1863c6.tar.gz
More cleanups.
-Erik
Diffstat (limited to 'utility.c')
-rw-r--r--utility.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/utility.c b/utility.c
index 2b21566..d39e9a1 100644
--- a/utility.c
+++ b/utility.c
@@ -820,12 +820,12 @@ extern int parse_mode(const char *s, mode_t * theMode)
* This uses buf as storage to hold things.
*
*/
-unsigned long my_getid(const char *filename, char *name, unsigned long id, unsigned long *gid)
+unsigned long my_getid(const char *filename, char *name, long id, long *gid)
{
FILE *file;
char *rname, *start, *end, buf[128];
- unsigned long rid;
- unsigned long rgid = 0;
+ long rid;
+ long rgid = 0;
file = fopen(filename, "r");
if (file == NULL) {
@@ -881,33 +881,33 @@ unsigned long my_getid(const char *filename, char *name, unsigned long id, unsig
}
/* returns a uid given a username */
-unsigned long my_getpwnam(char *name)
+long my_getpwnam(char *name)
{
return my_getid("/etc/passwd", name, -1, NULL);
}
/* returns a gid given a group name */
-unsigned long my_getgrnam(char *name)
+long my_getgrnam(char *name)
{
return my_getid("/etc/group", name, -1, NULL);
}
/* gets a username given a uid */
-void my_getpwuid(char *name, unsigned long uid)
+void my_getpwuid(char *name, long uid)
{
my_getid("/etc/passwd", name, uid, NULL);
}
/* gets a groupname given a gid */
-void my_getgrgid(char *group, unsigned long gid)
+void my_getgrgid(char *group, long gid)
{
my_getid("/etc/group", group, gid, NULL);
}
/* gets a gid given a user name */
-unsigned long my_getpwnamegid(char *name)
+long my_getpwnamegid(char *name)
{
- unsigned long gid;
+ long gid;
my_getid("/etc/passwd", name, -1, &gid);
return gid;
}