X-Git-Url: http://club.cc.cmu.edu/~cmccabe/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=simple_time.c;h=0055e1c968051aaccdb041980cb9b66f13861d4c;hb=f6b5e5eaa2e641d32878ff485f3e54de2eb35552;hp=59064090d459622a735d964a61123352fb2145ad;hpb=fbbdb383f35b0956626982ec3757641ac4f000b1;p=cmccabe-bin diff --git a/simple_time.c b/simple_time.c index 5906409..0055e1c 100644 --- a/simple_time.c +++ b/simple_time.c @@ -1,3 +1,5 @@ +#define _POSIX_PTHREAD_SEMANTICS // needed for Solaris for asctime_r + #include #include #include @@ -24,13 +26,11 @@ int main(void) { while (1) { char str[27]; - size_t len; time_t t = time(NULL); struct tm *tm = localtime(&t); str[0] = '\0'; asctime_r(tm, str); - len = strlen(str); printf("\r"); strip_newlines(str); printf("%s", str);