summaryrefslogtreecommitdiff
path: root/usr/src/cmd/stat/common/common.c
diff options
context:
space:
mode:
authorKrishnendu Sadhukhan - Sun Microsystems <Krishnendu.Sadhukhan@Sun.COM>2009-08-05 20:39:41 -0700
committerKrishnendu Sadhukhan - Sun Microsystems <Krishnendu.Sadhukhan@Sun.COM>2009-08-05 20:39:41 -0700
commit26fd77009b17f8c8fb32eb362584cfd635e87ad9 (patch)
tree6d69403d719d85f7ed8586b733a77f04743e25f4 /usr/src/cmd/stat/common/common.c
parent7ff836697c120cb94bd30d5c2204eb9b74718e4c (diff)
downloadillumos-joyent-26fd77009b17f8c8fb32eb362584cfd635e87ad9.tar.gz
6824918 timestamp option for xxstat commands
PSARC/2009/307 Time Stamp Option for xxstat Commands Phase II Contributed by Chad Mynhier <cmynhier@gmail.com>
Diffstat (limited to 'usr/src/cmd/stat/common/common.c')
-rw-r--r--usr/src/cmd/stat/common/common.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/usr/src/cmd/stat/common/common.c b/usr/src/cmd/stat/common/common.c
index 0bf50b9d3b..9fc3b99715 100644
--- a/usr/src/cmd/stat/common/common.c
+++ b/usr/src/cmd/stat/common/common.c
@@ -30,13 +30,10 @@
#include <errno.h>
#include <string.h>
#include <stdlib.h>
-#include <langinfo.h>
extern char *cmdname;
extern int caught_cont;
-uint_t timestamp_fmt = NODATE;
-
/*PRINTFLIKE2*/
void
fail(int do_perror, char *message, ...)
@@ -128,29 +125,3 @@ cont_handler(int sig_number)
(void) signal(sig_number, cont_handler);
caught_cont = 1;
}
-
-/*
- * Print timestamp as decimal reprentation of time_t value (-T u was specified)
- * or in date(1) format (-T d was specified).
- */
-void
-print_timestamp(void)
-{
- time_t t = time(NULL);
- static char *fmt = NULL;
-
- /* We only need to retrieve this once per invocation */
- if (fmt == NULL)
- fmt = nl_langinfo(_DATE_FMT);
-
- if (timestamp_fmt == UDATE) {
- (void) printf("%ld\n", t);
- } else if (timestamp_fmt == DDATE) {
- char dstr[64];
- int len;
-
- len = strftime(dstr, sizeof (dstr), fmt, localtime(&t));
- if (len > 0)
- (void) printf("%s\n", dstr);
- }
-}