summaryrefslogtreecommitdiffstats
path: root/usr.bin/ldd
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2008-08-02 12:04:59 +0000
committerjhb <jhb@FreeBSD.org>2008-08-02 12:04:59 +0000
commit192012a04e0d09518c8e8621972b7df38af94470 (patch)
treeecbc6db20b5a43bd429e79b4ad2e5162416efc9e /usr.bin/ldd
parent274fe7a6fc81c4fa13310ab0ad4de8886776482c (diff)
downloadFreeBSD-src-192012a04e0d09518c8e8621972b7df38af94470.zip
FreeBSD-src-192012a04e0d09518c8e8621972b7df38af94470.tar.gz
A few style and whitespace fixes.
Submitted by: bde
Diffstat (limited to 'usr.bin/ldd')
-rw-r--r--usr.bin/ldd/ldd.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/usr.bin/ldd/ldd.c b/usr.bin/ldd/ldd.c
index 53da65e..f83632a 100644
--- a/usr.bin/ldd/ldd.c
+++ b/usr.bin/ldd/ldd.c
@@ -83,7 +83,6 @@ execldd32(char *file, char *fmt1, char *fmt2, int aflag, int vflag)
int i, rval, status;
unsetenv(LD_ "TRACE_LOADED_OBJECTS");
-
rval = 0;
i = 0;
argv[i++] = strdup(_PATH_LDD32);
@@ -91,15 +90,14 @@ execldd32(char *file, char *fmt1, char *fmt2, int aflag, int vflag)
argv[i++] = strdup("-a");
if (vflag)
argv[i++] = strdup("-v");
- if (fmt1) {
+ if (fmt1 != NULL) {
argv[i++] = strdup("-f");
argv[i++] = strdup(fmt1);
}
- if (fmt2) {
+ if (fmt2 != NULL) {
argv[i++] = strdup("-f");
argv[i++] = strdup(fmt2);
}
-
argv[i++] = strdup(file);
argv[i++] = NULL;
@@ -110,16 +108,15 @@ execldd32(char *file, char *fmt1, char *fmt2, int aflag, int vflag)
case 0:
execv(_PATH_LDD32, argv);
warn("%s", _PATH_LDD32);
- _exit(1);
+ _exit(127);
break;
default:
- if (wait(&status) <= 0) {
+ if (wait(&status) < 0)
rval = 1;
- } else if (WIFSIGNALED(status)) {
+ else if (WIFSIGNALED(status))
rval = 1;
- } else if (WIFEXITED(status) && WEXITSTATUS(status)) {
+ else if (WIFEXITED(status) && WEXITSTATUS(status) != 0)
rval = 1;
- }
break;
}
while (i--)
@@ -232,14 +229,15 @@ main(int argc, char *argv[])
err(1, "fork");
break;
default:
- if (wait(&status) <= 0) {
+ if (wait(&status) < 0) {
warn("wait");
rval |= 1;
} else if (WIFSIGNALED(status)) {
fprintf(stderr, "%s: signal %d\n", *argv,
WTERMSIG(status));
rval |= 1;
- } else if (WIFEXITED(status) && WEXITSTATUS(status)) {
+ } else if (WIFEXITED(status) &&
+ WEXITSTATUS(status) != 0) {
fprintf(stderr, "%s: exit status %d\n", *argv,
WEXITSTATUS(status));
rval |= 1;
OpenPOWER on IntegriCloud