diff options
author | Eric Andersen | 2000-07-10 23:39:44 +0000 |
---|---|---|
committer | Eric Andersen | 2000-07-10 23:39:44 +0000 |
commit | da1d1e763d5f4dbdc2c5afd7d5034ed979a15d71 (patch) | |
tree | f1a3b22ce19c5b6c1599baa6afa89712b1230d53 /utility.c | |
parent | cc54d12ef716e9206344c18006b46386fe49ba9b (diff) | |
download | busybox-da1d1e763d5f4dbdc2c5afd7d5034ed979a15d71.zip busybox-da1d1e763d5f4dbdc2c5afd7d5034ed979a15d71.tar.gz |
Fixed NFS so it supports 2.4.x kernels and NFSv3. Should close bug #1009.
-Erik
Diffstat (limited to 'utility.c')
-rw-r--r-- | utility.c | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -1456,6 +1456,36 @@ extern void *xmalloc(size_t size) return cp; } +#if defined BB_FEATURE_NFSMOUNT +extern char * xstrdup (const char *s) { + char *t; + + if (s == NULL) + return NULL; + + t = strdup (s); + + if (t == NULL) + fatalError(memory_exhausted, ""); + + return t; +} + +extern char * xstrndup (const char *s, int n) { + char *t; + + if (s == NULL) + fatalError("xstrndup bug"); + + t = xmalloc(n+1); + strncpy(t,s,n); + t[n] = 0; + + return t; +} +#endif + + #if (__GLIBC__ < 2) && (defined BB_SYSLOGD || defined BB_INIT) extern int vdprintf(int d, const char *format, va_list ap) { |