style and message text fixes

This commit is contained in:
Denis Vlasenko 2007-09-27 10:17:53 +00:00
parent 86b29ea9e8
commit 1acdc89e99
2 changed files with 13 additions and 17 deletions

View File

@ -324,7 +324,7 @@ static int ChangeUser(const char *user, short dochdir)
pas = getpwnam(user); pas = getpwnam(user);
if (pas == NULL) { if (pas == NULL) {
bb_perror_msg_and_die("failed to get uid for %s", user); bb_perror_msg_and_die("cannot get uid for %s", user);
} }
setenv("USER", pas->pw_name, 1); setenv("USER", pas->pw_name, 1);
setenv("HOME", pas->pw_dir, 1); setenv("HOME", pas->pw_dir, 1);

View File

@ -99,23 +99,19 @@ static void print_perms(int id, struct ipc_perm *ipcp)
printf("%-10d %-10o", id, ipcp->mode & 0777); printf("%-10d %-10o", id, ipcp->mode & 0777);
if ((pw = getpwuid(ipcp->cuid))) pw = getpwuid(ipcp->cuid);
printf(" %-10s", pw->pw_name); if (pw) printf(" %-10s", pw->pw_name);
else else printf(" %-10d", ipcp->cuid);
printf(" %-10d", ipcp->cuid); gr = getgrgid(ipcp->cgid);
if ((gr = getgrgid(ipcp->cgid))) if (gr) printf(" %-10s", gr->gr_name);
printf(" %-10s", gr->gr_name); else printf(" %-10d", ipcp->cgid);
else
printf(" %-10d", ipcp->cgid);
if ((pw = getpwuid(ipcp->uid))) pw = getpwuid(ipcp->uid);
printf(" %-10s", pw->pw_name); if (pw) printf(" %-10s", pw->pw_name);
else else printf(" %-10d", ipcp->uid);
printf(" %-10d", ipcp->uid); gr = getgrgid(ipcp->gid);
if ((gr = getgrgid(ipcp->gid))) if (gr) printf(" %-10s\n", gr->gr_name);
printf(" %-10s\n", gr->gr_name); else printf(" %-10d\n", ipcp->gid);
else
printf(" %-10d\n", ipcp->gid);
} }