diff options
author | Kurt Miller <kurt@cvs.openbsd.org> | 2005-09-16 23:30:27 +0000 |
---|---|---|
committer | Kurt Miller <kurt@cvs.openbsd.org> | 2005-09-16 23:30:27 +0000 |
commit | e39b53525ada0ec2abed36cc4ea46f612eb5aced (patch) | |
tree | c8faddecf32e230174ec0fe962171d94b4cc0d19 /regress/libexec/ld.so | |
parent | d36f8d2330d23674c94b61bcb72ff3861f495c72 (diff) |
return 1 instead of -1 on error. noticed by theo.
Diffstat (limited to 'regress/libexec/ld.so')
-rw-r--r-- | regress/libexec/ld.so/dlsym/test1/libaa/aa.c | 12 | ||||
-rw-r--r-- | regress/libexec/ld.so/dlsym/test1/prog2/main.c | 12 | ||||
-rw-r--r-- | regress/libexec/ld.so/dlsym/test2/libbb/bb.c | 22 | ||||
-rw-r--r-- | regress/libexec/ld.so/dlsym/test2/prog1/main.c | 14 | ||||
-rw-r--r-- | regress/libexec/ld.so/dlsym/test2/prog2/main.c | 4 | ||||
-rw-r--r-- | regress/libexec/ld.so/dlsym/test2/prog3/main.c | 14 |
6 files changed, 39 insertions, 39 deletions
diff --git a/regress/libexec/ld.so/dlsym/test1/libaa/aa.c b/regress/libexec/ld.so/dlsym/test1/libaa/aa.c index 40605596337..0cf335db45b 100644 --- a/regress/libexec/ld.so/dlsym/test1/libaa/aa.c +++ b/regress/libexec/ld.so/dlsym/test1/libaa/aa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aa.c,v 1.2 2005/09/15 13:28:31 kurt Exp $ */ +/* $OpenBSD: aa.c,v 1.3 2005/09/16 23:30:25 kurt Exp $ */ /* * Copyright (c) 2005 Kurt Miller <kurt@openbsd.org> @@ -54,14 +54,14 @@ aaTest() printf("sigprocmask == %p\n", &sigprocmask); printf("libaa_sigprocmask == %p\n", libaa_sigprocmask); printf("libc_sigprocmask == %p\n", libc_sigprocmask); - return (-1); + return (1); } value = dlsym(RTLD_DEFAULT, "sigprocmask"); if (value != &sigprocmask) { printf("dlsym(RTLD_DEFAULT, \"sigprocmask\") == %p FAILED\n", value); printf("\twas expecting == %p (&sigprocmask)\n", &sigprocmask); - ret = -1; + ret = 1; } value = dlsym(RTLD_SELF, "sigprocmask"); @@ -69,21 +69,21 @@ aaTest() printf("dlsym(RTLD_SELF, \"sigprocmask\") == %p FAILED\n", value); printf("\twas expecting == %p (libaa_sigprocmask)\n", libaa_sigprocmask); printf("FAILED\n"); - ret = -1; + ret = 1; } value = dlsym(RTLD_NEXT, "sigprocmask"); if (value != libc_sigprocmask) { printf("dlsym(RTLD_NEXT, \"sigprocmask\") == %p FAILED\n", value); printf("\twas expecting == %p (libc_sigprocmask)\n", libc_sigprocmask); - ret = -1; + ret = 1; } value = dlsym(NULL, "sigprocmask"); if (value != libaa_sigprocmask) { printf("dlsym(NULL, \"sigprocmask\") == %p FAILED\n", value); printf("\twas expecting == %p (libaa_sigprocmask)\n", libaa_sigprocmask); - ret = -1; + ret = 1; } return (ret); diff --git a/regress/libexec/ld.so/dlsym/test1/prog2/main.c b/regress/libexec/ld.so/dlsym/test1/prog2/main.c index 6680fd45f5e..cc4ec5c6b91 100644 --- a/regress/libexec/ld.so/dlsym/test1/prog2/main.c +++ b/regress/libexec/ld.so/dlsym/test1/prog2/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.1 2005/09/15 15:37:15 kurt Exp $ */ +/* $OpenBSD: main.c,v 1.2 2005/09/16 23:30:25 kurt Exp $ */ /* * Copyright (c) 2005 Kurt Miller <kurt@openbsd.org> @@ -32,27 +32,27 @@ main() if (dlsym(RTLD_DEFAULT, "aaSymbol") == NULL) { printf("dlsym(RTLD_DEFAULT, \"aaSymbol\") FAILED\n"); - ret = -1; + ret = 1; } if (dlsym(RTLD_SELF, "aaSymbol") == NULL) { printf("dlsym(RTLD_SELF, \"aaSymbol\") FAILED\n"); - ret = -1; + ret = 1; } if (dlsym(RTLD_NEXT, "aaSymbol") == NULL) { printf("dlsym(RTLD_NEXT, \"aaSymbol\") FAILED\n"); - ret = -1; + ret = 1; } if (dlsym(NULL, "aaSymbol") == NULL) { printf("dlsym(RTLD_NEXT, \"aaSymbol\") FAILED\n"); - ret = -1; + ret = 1; } if (dlsym(exe_handle, "aaSymbol") == NULL) { printf("dlsym(exe_handle, \"aaSymbol\") FAILED\n"); - ret = -1; + ret = 1; } dlclose(exe_handle); diff --git a/regress/libexec/ld.so/dlsym/test2/libbb/bb.c b/regress/libexec/ld.so/dlsym/test2/libbb/bb.c index f6c98cfdde6..0c316ddb984 100644 --- a/regress/libexec/ld.so/dlsym/test2/libbb/bb.c +++ b/regress/libexec/ld.so/dlsym/test2/libbb/bb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bb.c,v 1.1 2005/09/15 22:16:27 kurt Exp $ */ +/* $OpenBSD: bb.c,v 1.2 2005/09/16 23:30:25 kurt Exp $ */ /* * Copyright (c) 2005 Kurt Miller <kurt@openbsd.org> @@ -36,61 +36,61 @@ bbTest1(void *libbb) /* check RTLD_DEFAULT can see symbols in main object group */ if (dlsym(RTLD_DEFAULT, "mainSymbol") == NULL) { printf("dlsym(RTLD_DEFAULT, \"mainSymbol\") == NULL\n"); - ret = -1; + ret = 1; } /* check RTLD_SELF can *not* see symbols in main object group */ if (dlsym(RTLD_SELF, "aaSymbol") != NULL) { printf("dlsym(RTLD_SELF, \"aaSymbol\") != NULL\n"); - ret = -1; + ret = 1; } /* check RTLD_NEXT can *not* see symbols in main object group */ if (dlsym(RTLD_NEXT, "aaSymbol") != NULL) { printf("dlsym(RTLD_NEXT, \"aaSymbol\") != NULL\n"); - ret = -1; + ret = 1; } /* check NULL can *not* see symbols in main object group */ if (dlsym(NULL, "aaSymbol") != NULL) { printf("dlsym(NULL, \"aaSymbol\") != NULL\n"); - ret = -1; + ret = 1; } /* check RTLD_SELF can see symbols in local object group */ if (dlsym(RTLD_SELF, "ccSymbol") == NULL) { printf("dlsym(RTLD_SELF, \"ccSymbol\") == NULL\n"); - ret = -1; + ret = 1; } /* check RTLD_NEXT can see symbols in local object group */ if (dlsym(RTLD_NEXT, "ccSymbol") == NULL) { printf("dlsym(RTLD_NEXT, \"ccSymbol\") == NULL\n"); - ret = -1; + ret = 1; } /* check NULL can see symbols in local object group */ if (dlsym(NULL, "ccSymbol") == NULL) { printf("dlsym(NULL, \"ccSymbol\") == NULL\n"); - ret = -1; + ret = 1; } /* check RTLD_NEXT skips libbb and can't find bbSymbol */ if (dlsym(RTLD_NEXT, "bbSymbol") != NULL) { printf("dlsym(RTLD_NEXT, \"bbSymbol\") != NULL\n"); - ret = -1; + ret = 1; } /* check dlsym(libbb,..) can *not* see symbols in libaa */ if (dlsym(libbb, "aaSymbol") != NULL) { printf("dlsym(libbb, \"aaSymbol\") != NULL\n"); - ret = -1; + ret = 1; } /* check dlsym(libbb,..) can see symbols in libcc */ if (dlsym(libbb, "ccSymbol") == NULL) { printf("dlsym(libbb, \"ccSymbol\") == NULL\n"); - ret = -1; + ret = 1; } return (ret); diff --git a/regress/libexec/ld.so/dlsym/test2/prog1/main.c b/regress/libexec/ld.so/dlsym/test2/prog1/main.c index 10cd73a06ae..530afff5187 100644 --- a/regress/libexec/ld.so/dlsym/test2/prog1/main.c +++ b/regress/libexec/ld.so/dlsym/test2/prog1/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.1 2005/09/15 22:16:27 kurt Exp $ */ +/* $OpenBSD: main.c,v 1.2 2005/09/16 23:30:26 kurt Exp $ */ /* * Copyright (c) 2005 Kurt Miller <kurt@openbsd.org> @@ -34,37 +34,37 @@ main() if (libbb == NULL) { printf("dlopen(\"libbb.so\", RTLD_LAZY) FAILED\n"); - return (-1); + return (1); } /* RTLD_DEFAULT should see bbSymbol */ if (dlsym(RTLD_DEFAULT, "bbSymbol") == NULL) { printf("dlsym(RTLD_DEFAULT, \"bbSymbol\") == NULL\n"); - ret = -1; + ret = 1; } /* RTLD_SELF should *not* see bbSymbol (different load group) */ if (dlsym(RTLD_SELF, "bbSymbol") != NULL) { printf("dlsym(RTLD_SELF, \"bbSymbol\") != NULL\n"); - ret = -1; + ret = 1; } /* RTLD_NEXT should *not* see bbSymbol (different load group) */ if (dlsym(RTLD_NEXT, "bbSymbol") != NULL) { printf("dlsym(RTLD_NEXT, \"bbSymbol\") != NULL\n"); - ret = -1; + ret = 1; } /* NULL should *not* see bbSymbol (different load group) */ if (dlsym(NULL, "bbSymbol") != NULL) { printf("dlsym(NULL, \"bbSymbol\") != NULL\n"); - ret = -1; + ret = 1; } /* exe handle should *not* see bbSymbol (different load group) */ if (dlsym(exe_handle, "bbSymbol") != NULL) { printf("dlsym(exe_handle, \"bbSymbol\") != NULL\n"); - ret = -1; + ret = 1; } dlclose(exe_handle); diff --git a/regress/libexec/ld.so/dlsym/test2/prog2/main.c b/regress/libexec/ld.so/dlsym/test2/prog2/main.c index fc007ebc6b2..4a7f664dee7 100644 --- a/regress/libexec/ld.so/dlsym/test2/prog2/main.c +++ b/regress/libexec/ld.so/dlsym/test2/prog2/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.1 2005/09/15 22:16:27 kurt Exp $ */ +/* $OpenBSD: main.c,v 1.2 2005/09/16 23:30:26 kurt Exp $ */ /* * Copyright (c) 2005 Kurt Miller <kurt@openbsd.org> @@ -29,7 +29,7 @@ main() if (libbb == NULL) { printf("dlopen(\"libbb.so\", RTLD_LAZY) FAILED\n"); - return (-1); + return (1); } int (*bbTest1)(void *) = dlsym(libbb, "bbTest1"); diff --git a/regress/libexec/ld.so/dlsym/test2/prog3/main.c b/regress/libexec/ld.so/dlsym/test2/prog3/main.c index c23e95850b2..6c1e50f4310 100644 --- a/regress/libexec/ld.so/dlsym/test2/prog3/main.c +++ b/regress/libexec/ld.so/dlsym/test2/prog3/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.1 2005/09/15 22:16:27 kurt Exp $ */ +/* $OpenBSD: main.c,v 1.2 2005/09/16 23:30:26 kurt Exp $ */ /* * Copyright (c) 2005 Kurt Miller <kurt@openbsd.org> @@ -35,37 +35,37 @@ main() if (libbb == NULL) { printf("dlopen(\"libbb.so\", RTLD_LAZY|RTLD_GLOBAL) FAILED\n"); - return (-1); + return (1); } /* RTLD_DEFAULT should see bbSymbol */ if (dlsym(RTLD_DEFAULT, "bbSymbol") == NULL) { printf("dlsym(RTLD_DEFAULT, \"bbSymbol\") == NULL\n"); - ret = -1; + ret = 1; } /* RTLD_SELF should see bbSymbol (RTLD_GLOBAL load group) */ if (dlsym(RTLD_SELF, "bbSymbol") == NULL) { printf("dlsym(RTLD_SELF, \"bbSymbol\") == NULL\n"); - ret = -1; + ret = 1; } /* RTLD_NEXT should see bbSymbol (RTLD_GLOBAL load group) */ if (dlsym(RTLD_NEXT, "bbSymbol") == NULL) { printf("dlsym(RTLD_NEXT, \"bbSymbol\") == NULL\n"); - ret = -1; + ret = 1; } /* NULL should *not* see bbSymbol (different load group) */ if (dlsym(NULL, "bbSymbol") != NULL) { printf("dlsym(NULL, \"bbSymbol\") != NULL\n"); - ret = -1; + ret = 1; } /* exe handle should *not* see bbSymbol (different load group) */ if (dlsym(exe_handle, "bbSymbol") != NULL) { printf("dlsym(exe_handle, \"bbSymbol\") != NULL\n"); - ret = -1; + ret = 1; } dlclose(exe_handle); |