summaryrefslogtreecommitdiff
path: root/build/names.c
diff options
context:
space:
mode:
authorjbj <devnull@localhost>1998-11-20 20:18:22 +0000
committerjbj <devnull@localhost>1998-11-20 20:18:22 +0000
commita15a36abd12dba7dcf5cab390100dfcbc16dd6b8 (patch)
tree95578f21fd63f1fd2afdc18d1019d9346bc695a9 /build/names.c
parent8f2a5b4031cba427d46b8d19a8da5d30eddb2f4a (diff)
downloadlibrpm-tizen-a15a36abd12dba7dcf5cab390100dfcbc16dd6b8.tar.gz
librpm-tizen-a15a36abd12dba7dcf5cab390100dfcbc16dd6b8.tar.bz2
librpm-tizen-a15a36abd12dba7dcf5cab390100dfcbc16dd6b8.zip
Sanity.
CVS patchset: 2551 CVS date: 1998/11/20 20:18:22
Diffstat (limited to 'build/names.c')
-rw-r--r--build/names.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/build/names.c b/build/names.c
index e738dc5fd..22e1ddeab 100644
--- a/build/names.c
+++ b/build/names.c
@@ -21,18 +21,16 @@ char *getUname(uid_t uid)
struct passwd *pw;
int x;
- x = 0;
- while (x < uid_used) {
+ for (x = 0; x < uid_used; x++) {
if (uids[x] == uid) {
return unames[x];
}
- x++;
}
/* XXX - This is the other hard coded limit */
if (x == 1024) {
fprintf(stderr, _("RPMERR_INTERNAL: Hit limit in getUname()\n"));
- exit(RPMERR_INTERNAL);
+ exit(EXIT_FAILURE);
}
pw = getpwuid(uid);
@@ -55,18 +53,16 @@ char *getUnameS(char *uname)
struct passwd *pw;
int x;
- x = 0;
- while (x < uid_used) {
+ for (x = 0; x < uid_used; x++) {
if (!strcmp(unames[x],uname)) {
return unames[x];
}
- x++;
}
/* XXX - This is the other hard coded limit */
if (x == 1024) {
fprintf(stderr, _("RPMERR_INTERNAL: Hit limit in getUname()\n"));
- exit(RPMERR_INTERNAL);
+ exit(EXIT_FAILURE);
}
pw = getpwnam(uname);
@@ -90,18 +86,16 @@ char *getGname(gid_t gid)
struct group *gr;
int x;
- x = 0;
- while (x < gid_used) {
+ for (x = 0; x < gid_used; x++) {
if (gids[x] == gid) {
return gnames[x];
}
- x++;
}
/* XXX - This is the other hard coded limit */
if (x == 1024) {
fprintf(stderr, _("RPMERR_INTERNAL: Hit limit in getGname()\n"));
- exit(RPMERR_INTERNAL);
+ exit(EXIT_FAILURE);
}
gr = getgrgid(gid);
@@ -124,18 +118,16 @@ char *getGnameS(char *gname)
struct group *gr;
int x;
- x = 0;
- while (x < gid_used) {
+ for (x = 0; x < gid_used; x++) {
if (!strcmp(gnames[x], gname)) {
return gnames[x];
}
- x++;
}
/* XXX - This is the other hard coded limit */
if (x == 1024) {
fprintf(stderr, _("RPMERR_INTERNAL: Hit limit in getGname()\n"));
- exit(RPMERR_INTERNAL);
+ exit(EXIT_FAILURE);
}
gr = getgrnam(gname);
@@ -150,7 +142,7 @@ char *getGnameS(char *gname)
return gnames[x];
}
-time_t *getBuildTime(void)
+time_t *const getBuildTime(void)
{
static time_t buildTime = 0;
@@ -161,7 +153,7 @@ time_t *getBuildTime(void)
return &buildTime;
}
-char *buildHost(void)
+char *const buildHost(void)
{
static char hostname[1024];
static int gotit = 0;