Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 174858 Details for
Bug 89046
Rsync logging time incorrectly
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Sample c code demonstating problem
tztest.c (text/plain), 701 bytes, created by
Marcin Deranek
on 2008-12-10 13:39:04 UTC
(
hide
)
Description:
Sample c code demonstating problem
Filename:
MIME Type:
Creator:
Marcin Deranek
Created:
2008-12-10 13:39:04 UTC
Size:
701 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("1: %s current time\n", timestring(now)); > printf("2: %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 89046
:
73641
| 174858