apply patch from https://github.com/davidrg/mars_nwe/issues/1#issuecomment-2259477604
This commit is contained in:
@@ -882,7 +882,7 @@ static int build_path( NW_PATH *path,
|
||||
if (len > 255) len = 255;
|
||||
conn_build_path_fn(vol,
|
||||
path->path,
|
||||
(only_dir) ? (uint8)NULL
|
||||
(only_dir) ? NULL
|
||||
: path->fn,
|
||||
&(path->has_wild),
|
||||
data, len, sizeof(path->fn));
|
||||
|
||||
37
src/tools.c
37
src/tools.c
@@ -21,6 +21,27 @@
|
||||
#include <stdarg.h>
|
||||
#include <syslog.h>
|
||||
|
||||
#if 0
|
||||
#ifndef LINUX
|
||||
extern int _sys_nerr;
|
||||
extern char *_sys_errlist[];
|
||||
#else
|
||||
# ifndef __USE_GNU
|
||||
# define _sys_nerr sys_nerr
|
||||
# define _sys_errlist sys_errlist
|
||||
# endif
|
||||
#endif
|
||||
#else
|
||||
# ifndef __USE_GNU
|
||||
# ifdef FREEBSD
|
||||
# define _sys_nerr sys_nerr
|
||||
# define _sys_errlist sys_errlist
|
||||
# else
|
||||
extern int _sys_nerr;
|
||||
extern char *_sys_errlist[];
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
int nw_debug=0;
|
||||
uint32 debug_mask=0; /* special debug masks */
|
||||
@@ -161,7 +182,8 @@ static char *buffered=NULL;
|
||||
if (mode & 0x10) {
|
||||
int l=sprintf(pb, ", errno=%d", errnum);
|
||||
pb+=l;
|
||||
l=sprintf(pb, " (%s)", strerror(errnum));
|
||||
if (errnum > 0)
|
||||
l=sprintf(pb, " (%s)", strerror(errnum));
|
||||
}
|
||||
if (!(mode & 2)) {
|
||||
char identstr[200];
|
||||
@@ -186,7 +208,8 @@ static char *buffered=NULL;
|
||||
va_end(ap);
|
||||
}
|
||||
if (mode & 0x10) {
|
||||
fprintf(logfile, ", errno=%d", strerror(errnum));
|
||||
fprintf(logfile, ", errno=%d", errnum);
|
||||
if (errnum > 0)
|
||||
fprintf(logfile, " (%s)", strerror(errnum));
|
||||
}
|
||||
if (!(mode & 2))
|
||||
@@ -213,11 +236,11 @@ void errorp(int mode, char *what, char *p, ...)
|
||||
errnum = -1;
|
||||
mode -= 10;
|
||||
}
|
||||
// if (errnum >= 0 && errnum < _sys_nerr) errstr = _sys_errlist[errnum];
|
||||
// else if (errnum > -1)
|
||||
sprintf(errbuf, "errno=%d", strerror(errnum));
|
||||
// else
|
||||
// errbuf[0] = '\0';
|
||||
if (errnum >= 0) errstr = strerror(errnum);
|
||||
else if (errnum > -1)
|
||||
sprintf(errbuf, "errno=%d", errnum);
|
||||
else
|
||||
errbuf[0] = '\0';
|
||||
|
||||
if (use_syslog) {
|
||||
int prio=(mode) ? LOG_CRIT : LOG_ERR;
|
||||
|
||||
@@ -24,6 +24,7 @@ void write_utmp(int dologin, int connection, int pid,
|
||||
#ifndef FREEBSD
|
||||
struct utmp loc_ut;
|
||||
struct utmp *ut;
|
||||
struct timeval tv;
|
||||
int fd;
|
||||
char buff[200];
|
||||
int found = 0;
|
||||
@@ -67,7 +68,10 @@ void write_utmp(int dologin, int connection, int pid,
|
||||
memset(ut->ut_user, 0, sizeof(ut->ut_user));
|
||||
ut->ut_pid = 0;
|
||||
}
|
||||
(void)time(&(ut->ut_time));
|
||||
gettimeofday(&tv, NULL);
|
||||
ut->ut_tv.tv_sec=tv.tv_sec;
|
||||
ut->ut_tv.tv_usec=tv.tv_usec;
|
||||
|
||||
pututline(ut);
|
||||
endutent();
|
||||
if (NULL == fn_wtmp) return;
|
||||
|
||||
Reference in New Issue
Block a user