Skip to content

Commit

Permalink
end this nonsense locally, until the next obsd import
Browse files Browse the repository at this point in the history
  • Loading branch information
mirabilos committed Oct 14, 2015
1 parent 34f4977 commit 488a415
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 37 deletions.
7 changes: 3 additions & 4 deletions extern.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/** $MirOS: src/bin/pax/extern.h,v 1.25 2013/10/31 20:05:40 tg Exp $ */
/** $MirOS: src/bin/pax/extern.h,v 1.26 2015/10/14 18:10:08 tg Exp $ */
/* $OpenBSD: extern.h,v 1.34 2010/12/02 04:08:27 tedu Exp $ */
/* $NetBSD: extern.h,v 1.5 1996/03/26 23:54:16 mrg Exp $ */

/*-
* Copyright © 2013
* Thorsten “mirabilos” Glaser <tg@mirbsd.org>
* Copyright © 2013, 2015
* mirabilos <m@mirbsd.org>
* Copyright (c) 1992 Keith Muller.
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
Expand Down Expand Up @@ -258,7 +258,6 @@ extern int rmleadslash;
extern int exit_val;
extern int docrc;
extern char *dirptr;
extern char *ltmfrmt;
extern const char *argv0;
extern FILE *listf;
extern char *tempfile;
Expand Down
35 changes: 11 additions & 24 deletions gen_subs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
/* $NetBSD: gen_subs.c,v 1.5 1995/03/21 09:07:26 cgd Exp $ */

/*-
* Copyright (c) 2012
* Thorsten Glaser <tg@debian.org>
* Copyright (c) 2012, 2015
* mirabilos <m@mirbsd.org>
* Copyright (c) 1992 Keith Muller.
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
Expand Down Expand Up @@ -55,7 +55,7 @@
#include "pax.h"
#include "extern.h"

__RCSID("$MirOS: src/bin/pax/gen_subs.c,v 1.15 2012/06/05 20:20:39 tg Exp $");
__RCSID("$MirOS: src/bin/pax/gen_subs.c,v 1.16 2015/10/14 18:10:08 tg Exp $");

/*
* a collection of general purpose subroutines used by pax
Expand Down Expand Up @@ -106,17 +106,10 @@ ls_list(ARCHD *arcn, time_t now, FILE *fp)
sbp = &(arcn->sb);
strmode(sbp->st_mode, f_mode);

if (ltmfrmt == NULL) {
/*
* no locale specified format. time format based on age
* compared to the time pax was started.
*/
if ((sbp->st_mtime + SIXMONTHS) <= now)
timefrmt = OLDFRMT;
else
timefrmt = CURFRMT;
} else
timefrmt = ltmfrmt;
if ((sbp->st_mtime + SIXMONTHS) <= now)
timefrmt = OLDFRMT;
else
timefrmt = CURFRMT;

/*
* print file mode, link count, uid, gid and time
Expand Down Expand Up @@ -167,16 +160,10 @@ ls_tty(ARCHD *arcn)
char f_mode[MODELEN];
const char *timefrmt;

if (ltmfrmt == NULL) {
/*
* no locale specified format
*/
if ((arcn->sb.st_mtime + SIXMONTHS) <= time(NULL))
timefrmt = OLDFRMT;
else
timefrmt = CURFRMT;
} else
timefrmt = ltmfrmt;
if ((arcn->sb.st_mtime + SIXMONTHS) <= time(NULL))
timefrmt = OLDFRMT;
else
timefrmt = CURFRMT;

/*
* convert time to string, and print
Expand Down
10 changes: 1 addition & 9 deletions pax.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#include "pax.h"
#include "extern.h"

__RCSID("$MirOS: src/bin/pax/pax.c,v 1.20 2015/10/13 20:11:41 tg Exp $");
__RCSID("$MirOS: src/bin/pax/pax.c,v 1.21 2015/10/14 18:10:08 tg Exp $");

static int gen_init(void);
static void sig_cleanup(int) __attribute__((__noreturn__));
Expand Down Expand Up @@ -95,7 +95,6 @@ int rmleadslash = 0; /* remove leading '/' from pathnames */
int exit_val; /* exit value */
int docrc; /* check/create file crc */
char *dirptr; /* destination dir in a copy */
char *ltmfrmt; /* -v locale time format (if any) */
const char *argv0; /* root of argv[0] */
sigset_t s_mask; /* signal mask for cleanup critical sect */
FILE *listf; /* fp to print file list to (default stderr) */
Expand Down Expand Up @@ -396,13 +395,6 @@ gen_init(void)
}
#endif

/*
* Handle posix locale
*
* set user defines time printing format for -v option
*/
ltmfrmt = getenv("LC_TIME");

/*
* signal handling to reset stored directory times and modes. Since
* we deal with broken pipes via failed writes we ignore it. We also
Expand Down

0 comments on commit 488a415

Please sign in to comment.