The Samba-Bugzilla – Attachment 1163 Details for
Bug 2607
Rsync logging time incorrectly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Output timestamp after a chroot call
tztest.c (text/x-csrc), 648 bytes, created by
Wayne Davison
on 2005-04-15 08:41:45 UTC
(
hide
)
Description:
Output timestamp after a chroot call
Filename:
MIME Type:
Creator:
Wayne Davison
Created:
2005-04-15 08:41:45 UTC
Size:
648 bytes
patch
obsolete
>#include <stdio.h> >#include <sys/time.h> >#include <time.h> > >#define HAVE_STRFTIME 1 > >char *timestring(time_t t) >{ > static char TimeBuf[200]; > struct tm *tm = localtime(&t); > >#ifdef HAVE_STRFTIME > strftime(TimeBuf, sizeof TimeBuf - 1, "%Y/%m/%d %H:%M:%S", tm); >#else > strlcpy(TimeBuf, asctime(tm), sizeof TimeBuf); >#endif > > if (TimeBuf[strlen(TimeBuf)-1] == '\n') { > TimeBuf[strlen(TimeBuf)-1] = 0; > } > > return(TimeBuf); >} > >int main(int argc, char *argv[]) >{ > time_t now; > > time(&now); > localtime(&now); > > if (chroot("/tmp") < 0) { > printf("Call to chroot() failed!\n"); > exit(1); > } > > printf("%s current time\n", timestring(now)); > > return 0; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 2607
: 1163