diff options
author | Derrell Lipman <derrell@samba.org> | 2005-06-21 20:34:24 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:57:21 -0500 |
commit | 3005405b521c2b88a4dcdaece505d8887d7d0c37 (patch) | |
tree | 9a58c55df467f7ae681cdd954a2675c604897714 /source3/libsmb | |
parent | b0b983cc60f51395c4f19d185c4e3b8b1e9dce1b (diff) | |
download | samba-3005405b521c2b88a4dcdaece505d8887d7d0c37.tar.gz samba-3005405b521c2b88a4dcdaece505d8887d7d0c37.tar.bz2 samba-3005405b521c2b88a4dcdaece505d8887d7d0c37.zip |
r7817: Eliminate use of ctime_r() in libsmbclient DEBUG statement. It seems that
ctime_r() takes different parameters on Solaris than it does on Linux, and
it's easier to just eliminate the use of it than to write a configure test.
(This used to be commit 513ea79b2ebc9a78c118042abca942da061d4647)
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/libsmbclient.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c index 2b511050ce..dac30b934e 100644 --- a/source3/libsmb/libsmbclient.c +++ b/source3/libsmb/libsmbclient.c @@ -3017,14 +3017,26 @@ int smbc_utimes_ctx(SMBCCTX *context, const char *fname, struct timeval *tbuf) m_time = tbuf[1].tv_sec; } + if (DEBUGLVL(4)) { + char *p; char atimebuf[32]; char mtimebuf[32]; - DEBUG(4, ("smbc_utimes(%s, atime = %s mtime = %s)\n", - fname, - ctime_r(&a_time, atimebuf), - ctime_r(&m_time, mtimebuf))); + strncpy(atimebuf, ctime(&a_time), sizeof(atimebuf)); + atimebuf[sizeof(atimebuf) - 1] = '\0'; + if ((p = strchr(atimebuf, '\n')) != NULL) { + *p = '\0'; + } + + strncpy(mtimebuf, ctime(&m_time), sizeof(mtimebuf)); + mtimebuf[sizeof(mtimebuf) - 1] = '\0'; + if ((p = strchr(mtimebuf, '\n')) != NULL) { + *p = '\0'; + } + + dbgtext("smbc_utimes(%s, atime = %s mtime = %s)\n", + fname, atimebuf, mtimebuf); } if (smbc_parse_path(context, fname, |