diff options
author | crunchy <crunchy> | 2003-02-26 16:34:44 +0000 |
---|---|---|
committer | crunchy <crunchy> | 2003-02-26 16:34:44 +0000 |
commit | 5bab60aa0971a0907718cb3ff50d4d1d2a0dc47e (patch) | |
tree | 4b9bede6c28fb1a85be401c095d5cbbc4160a491 /mpiosh | |
parent | 8ca6e0c3d3ad7a80ae5645cbfe007b83c4980c66 (diff) | |
download | mpiosh-5bab60aa0971a0907718cb3ff50d4d1d2a0dc47e.tar.gz mpiosh-5bab60aa0971a0907718cb3ff50d4d1d2a0dc47e.tar.bz2 mpiosh-5bab60aa0971a0907718cb3ff50d4d1d2a0dc47e.zip |
checking for kernel headers at a better place ;-) and tried to fix a bug in mpiosh_cmd_ldir
Diffstat (limited to 'mpiosh')
-rw-r--r-- | mpiosh/callback.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/mpiosh/callback.c b/mpiosh/callback.c index a88bbc9..7d3596e 100644 --- a/mpiosh/callback.c +++ b/mpiosh/callback.c @@ -2,7 +2,7 @@ * * Author: Andreas Büsching <crunchy@tzi.de> * - * $Id: callback.c,v 1.32 2002/11/13 23:05:28 germeier Exp $ + * $Id: callback.c,v 1.33 2003/02/26 16:34:45 crunchy Exp $ * * Copyright (C) 2001 Andreas Büsching <crunchy@tzi.de> * @@ -865,10 +865,23 @@ mpiosh_cmd_ldir(char *args[]) pwd = getpwuid(st.st_uid); grp = getgrgid(st.st_gid); strftime(time, 12, "%b %2d", localtime(&(st.st_mtime))); - printf("%s %8s %8s %8d %10s %s\n", - rights, pwd->pw_name, grp->gr_name, (int)st.st_size, - time, - (*run)->d_name); + if (pwd && grp) { + printf("%s %8s %8s %8d %10s %s\n", + rights, pwd->pw_name, grp->gr_name, (int)st.st_size, + time, (*run)->d_name); + } else if (pwd) { + printf("%s %8s %8d %8d %10s %s\n", + rights, pwd->pw_name, st.st_gid, (int)st.st_size, + time, (*run)->d_name); + } else if (grp) { + printf("%s %8d %8s %8d %10s %s\n", + rights, st.st_uid, grp->gr_name, (int)st.st_size, + time, (*run)->d_name); + } else { + printf("%s %8d %8d %8d %10s %s\n", + rights, st.st_uid, st.st_gid, (int)st.st_size, + time, (*run)->d_name); + } } free(*run); } |