diff options
author | green <green@FreeBSD.org> | 2000-10-27 01:19:02 +0000 |
---|---|---|
committer | green <green@FreeBSD.org> | 2000-10-27 01:19:02 +0000 |
commit | 4873d87d0313bcc3d9a31353fd591030e246cf2f (patch) | |
tree | adf27c85608039ef2dd105e501755589c140febc /lib/libutil/login_crypt.c | |
parent | f05284397ec89629b21217f6251a1d84737169f8 (diff) | |
download | FreeBSD-src-4873d87d0313bcc3d9a31353fd591030e246cf2f.zip FreeBSD-src-4873d87d0313bcc3d9a31353fd591030e246cf2f.tar.gz |
Fix problems people were having with large -O levels with GCC and
getting libutil/libcrypt to work properly. I've determined that GCC
thinks it can inline all functions, including weak-symboled ones, if
it feels like it.
Create a new stub.c and move any stubs there to prevent inlining.
Thanks to jdp and William S. Duncanson for helping me finally find the
problem.
Diffstat (limited to 'lib/libutil/login_crypt.c')
-rw-r--r-- | lib/libutil/login_crypt.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/libutil/login_crypt.c b/lib/libutil/login_crypt.c index b291100..e080ba9 100644 --- a/lib/libutil/login_crypt.c +++ b/lib/libutil/login_crypt.c @@ -29,19 +29,18 @@ #include <sys/types.h> #include <login_cap.h> +#include <stdio.h> +#include <stdlib.h> #include <unistd.h> -#pragma weak crypt_set_format -int -crypt_set_format(const char *f) { - return (0); -} - const char * login_setcryptfmt(login_cap_t *lc, const char *def, const char *error) { const char *cipher; - cipher = login_getcapstr(lc, "passwd_format", def, NULL); + cipher = login_getcapstr(lc, "passwd_format", (char *)def, NULL); + if (getenv("CRYPT_DEBUG") != NULL) + fprintf(stderr, "login_setcryptfmt: " + "passwd_format = %s\n", cipher); if (cipher == NULL) return (error); if (!crypt_set_format(cipher)) |