AC_CHECK_FUNCS(fgetpos memmove setegid srand48 strerror)
-AC_REPLACE_FUNCS([setenv strcasecmp strdup strsep strtok_r wcscasecmp])
+AC_REPLACE_FUNCS([setenv strcasecmp strsep strtok_r wcscasecmp])
AC_REPLACE_FUNCS([strcasestr mkdtemp])
AC_CHECK_FUNC(getopt)
static int Retry = MAXLOCKATTEMPT;
#ifdef DL_STANDALONE
-static char *Hostname;
+struct utsname utsname;
#endif
#ifdef USE_SETGID
{
int i;
char *p;
- struct utsname utsname;
/* first, drop privileges */
/* determine the system's host name */
uname (&utsname);
- if (!(Hostname = strdup (utsname.nodename))) /* __MEM_CHECKED__ */
- return DL_EX_ERROR;
- if ((p = strchr (Hostname, '.')))
+ if ((p = strchr (utsname.nodename, '.')))
*p = '\0';
time_t t;
snprintf (nfslockfile, sizeof (nfslockfile), "%s.%s.%d",
- realpath, Hostname, (int) getpid ());
+ realpath,
+#ifdef DL_STANDALONE
+ utsname.nodename,
+#else
+ Hostname,
+#endif
+ (int) getpid ());
snprintf (lockfile, sizeof (lockfile), "%s.lock", realpath);
int strncasecmp (char *, char *, size_t);
#endif
-#ifndef HAVE_STRDUP
-char *strdup (const char *);
-#endif
-
#ifndef HAVE_STRSEP
char *strsep (char **, const char *);
#endif
+++ /dev/null
-/* ultrix doesn't have strdup */
-
-#include <string.h>
-#include <stdlib.h>
-
-char *strdup (const char *s) /* __MEM_CHECKED__ */
-{
- char *d;
-
- if (s == NULL)
- return NULL;
-
- if ((d = malloc (strlen (s) + 1)) == NULL) /* __MEM_CHECKED__ */
- return NULL;
-
- memcpy (d, s, strlen (s) + 1);
- return d;
-}
-