Skip to content

Commit 549f6d7

Browse files
committed
NetBSD src for "user", checkout.sh rev 3d7207df3ee831968994bfb61e516b7e26aaed05
1 parent 4096816 commit 549f6d7

File tree

542 files changed

+5982
-2626
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

542 files changed

+5982
-2626
lines changed

bin/cp/cp.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: cp.c,v 1.58 2012/01/04 15:58:37 christos Exp $ */
1+
/* $NetBSD: cp.c,v 1.59 2016/03/05 19:48:55 uwe Exp $ */
22

33
/*
44
* Copyright (c) 1988, 1993, 1994
@@ -43,7 +43,7 @@ __COPYRIGHT(
4343
#if 0
4444
static char sccsid[] = "@(#)cp.c 8.5 (Berkeley) 4/29/95";
4545
#else
46-
__RCSID("$NetBSD: cp.c,v 1.58 2012/01/04 15:58:37 christos Exp $");
46+
__RCSID("$NetBSD: cp.c,v 1.59 2016/03/05 19:48:55 uwe Exp $");
4747
#endif
4848
#endif /* not lint */
4949

@@ -145,7 +145,7 @@ main(int argc, char *argv[])
145145
iflag = 0;
146146
break;
147147
case 'i':
148-
iflag = isatty(fileno(stdin));
148+
iflag = 1;
149149
fflag = 0;
150150
break;
151151
case 'l':

bin/cp/utils.c

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: utils.c,v 1.44 2015/03/03 00:20:38 enami Exp $ */
1+
/* $NetBSD: utils.c,v 1.45 2016/02/29 04:22:21 mrg Exp $ */
22

33
/*-
44
* Copyright (c) 1991, 1993, 1994
@@ -34,7 +34,7 @@
3434
#if 0
3535
static char sccsid[] = "@(#)utils.c 8.3 (Berkeley) 4/1/94";
3636
#else
37-
__RCSID("$NetBSD: utils.c,v 1.44 2015/03/03 00:20:38 enami Exp $");
37+
__RCSID("$NetBSD: utils.c,v 1.45 2016/02/29 04:22:21 mrg Exp $");
3838
#endif
3939
#endif /* not lint */
4040

@@ -77,17 +77,18 @@ set_utimes(const char *file, struct stat *fs)
7777
struct finfo {
7878
const char *from;
7979
const char *to;
80-
size_t size;
80+
off_t size;
8181
};
8282

8383
static void
84-
progress(const struct finfo *fi, size_t written)
84+
progress(const struct finfo *fi, off_t written)
8585
{
8686
int pcent = (int)((100.0 * written) / fi->size);
8787

8888
pinfo = 0;
89-
(void)fprintf(stderr, "%s => %s %zu/%zu bytes %d%% written\n",
90-
fi->from, fi->to, written, fi->size, pcent);
89+
(void)fprintf(stderr, "%s => %s %llu/%llu bytes %d%% written\n",
90+
fi->from, fi->to, (unsigned long long)written,
91+
(unsigned long long)fi->size, pcent);
9192
}
9293

9394
int
@@ -97,7 +98,7 @@ copy_file(FTSENT *entp, int dne)
9798
struct stat to_stat, *fs;
9899
int ch, checkch, from_fd, rcount, rval, to_fd, tolnk, wcount;
99100
char *p;
100-
size_t ptotal = 0;
101+
off_t ptotal = 0;
101102

102103
if ((from_fd = open(entp->fts_path, O_RDONLY, 0)) == -1) {
103104
warn("%s", entp->fts_path);
@@ -184,7 +185,7 @@ copy_file(FTSENT *entp, int dne)
184185

185186
fi.from = entp->fts_path;
186187
fi.to = to.p_path;
187-
fi.size = (size_t)fs->st_size;
188+
fi.size = fs->st_size;
188189

189190
/*
190191
* Mmap and write if less than 8M (the limit is so

bin/df/df.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: df.c,v 1.90 2012/01/07 18:45:13 christos Exp $ */
1+
/* $NetBSD: df.c,v 1.92 2016/03/05 08:15:01 kamil Exp $ */
22

33
/*
44
* Copyright (c) 1980, 1990, 1993, 1994
@@ -45,7 +45,7 @@ __COPYRIGHT(
4545
#if 0
4646
static char sccsid[] = "@(#)df.c 8.7 (Berkeley) 4/2/94";
4747
#else
48-
__RCSID("$NetBSD: df.c,v 1.90 2012/01/07 18:45:13 christos Exp $");
48+
__RCSID("$NetBSD: df.c,v 1.92 2016/03/05 08:15:01 kamil Exp $");
4949
#endif
5050
#endif /* not lint */
5151

@@ -379,13 +379,13 @@ prtstat(struct statvfs *sfsp, int maxwidth)
379379
*/
380380
(void)printf("%10s (%-12s): %7ld block size %12ld frag size\n",
381381
sfsp->f_mntonname, sfsp->f_mntfromname,
382-
sfsp->f_iosize, /* On UFS/FFS systems this is
382+
sfsp->f_bsize, /* On UFS/FFS systems this is
383383
* also called the "optimal
384384
* transfer block size" but it
385385
* is of course the file
386386
* system's block size too.
387387
*/
388-
sfsp->f_bsize); /* not so surprisingly the
388+
sfsp->f_frsize); /* not so surprisingly the
389389
* "fundamental file system
390390
* block size" is the frag
391391
* size.
@@ -499,7 +499,7 @@ prtstat(struct statvfs *sfsp, int maxwidth)
499499
if (iflag) {
500500
inodes = sfsp->f_files;
501501
used = inodes - sfsp->f_ffree;
502-
(void)printf(" %8jd %8jd %3s%%",
502+
(void)printf(" %8jd %8jd %4s%%",
503503
(intmax_t)used, (intmax_t)sfsp->f_ffree,
504504
inodes == 0 ? (used == 0 ? empty : full) :
505505
strspct(pb, sizeof(pb), used, inodes, 0));

bin/ed/cbc.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: cbc.c,v 1.23 2014/03/23 05:06:42 dholland Exp $ */
1+
/* $NetBSD: cbc.c,v 1.24 2016/02/01 17:34:00 christos Exp $ */
22

33
/* cbc.c: This file contains the encryption routines for the ed line editor */
44
/*-
@@ -72,7 +72,7 @@
7272
#if 0
7373
static char *rcsid = "@(#)cbc.c,v 1.2 1994/02/01 00:34:36 alm Exp";
7474
#else
75-
__RCSID("$NetBSD: cbc.c,v 1.23 2014/03/23 05:06:42 dholland Exp $");
75+
__RCSID("$NetBSD: cbc.c,v 1.24 2016/02/01 17:34:00 christos Exp $");
7676
#endif
7777
#endif /* not lint */
7878

@@ -303,7 +303,7 @@ expand_des_key(char *obuf /* bit pattern */, char *inbuf /* the key itself */)
303303
/*
304304
* now translate it, bombing on any illegal hex digit
305305
*/
306-
for (i = 0; inbuf[i] && i < 16; i++)
306+
for (i = 0; i < 16 && inbuf[i]; i++)
307307
if ((nbuf[i] = hex_to_binary((int) inbuf[i], 16)) == -1)
308308
des_error("bad hex digit in key");
309309
while (i < 16)
@@ -323,7 +323,7 @@ expand_des_key(char *obuf /* bit pattern */, char *inbuf /* the key itself */)
323323
/*
324324
* now translate it, bombing on any illegal binary digit
325325
*/
326-
for (i = 0; inbuf[i] && i < 16; i++)
326+
for (i = 0; i < 16 && inbuf[i]; i++)
327327
if ((nbuf[i] = hex_to_binary((int) inbuf[i], 2)) == -1)
328328
des_error("bad binary digit in key");
329329
while (i < 64)

bin/ed/main.c

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: main.c,v 1.27 2014/03/31 12:55:46 christos Exp $ */
1+
/* $NetBSD: main.c,v 1.28 2016/03/02 19:11:28 christos Exp $ */
22

33
/* main.c: This file contains the main control and user-interface routines
44
for the ed line editor. */
@@ -39,7 +39,7 @@ __COPYRIGHT(
3939
#if 0
4040
static char *rcsid = "@(#)main.c,v 1.1 1994/02/01 00:34:42 alm Exp";
4141
#else
42-
__RCSID("$NetBSD: main.c,v 1.27 2014/03/31 12:55:46 christos Exp $");
42+
__RCSID("$NetBSD: main.c,v 1.28 2016/03/02 19:11:28 christos Exp $");
4343
#endif
4444
#endif /* not lint */
4545

@@ -223,11 +223,14 @@ main(int ac, char *av[])
223223
}
224224
isglobal = 0;
225225
if ((status = extract_addr_range()) >= 0 &&
226-
(status = exec_command()) >= 0)
227-
if (!status || (status &&
228-
(status = display_lines(current_addr, current_addr,
229-
status)) >= 0))
226+
(status = exec_command()) >= 0) {
227+
if (status == 0)
230228
continue;
229+
status = display_lines(current_addr, current_addr,
230+
status);
231+
if (status >= 0)
232+
continue;
233+
}
231234
switch (status) {
232235
case EOF:
233236
quit(0);

bin/mv/mv.c

+26-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: mv.c,v 1.44 2015/03/02 03:17:24 enami Exp $ */
1+
/* $NetBSD: mv.c,v 1.45 2016/02/28 10:59:29 mrg Exp $ */
22

33
/*
44
* Copyright (c) 1989, 1993, 1994
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993, 1994\
4242
#if 0
4343
static char sccsid[] = "@(#)mv.c 8.2 (Berkeley) 4/2/94";
4444
#else
45-
__RCSID("$NetBSD: mv.c,v 1.44 2015/03/02 03:17:24 enami Exp $");
45+
__RCSID("$NetBSD: mv.c,v 1.45 2016/02/28 10:59:29 mrg Exp $");
4646
#endif
4747
#endif /* not lint */
4848

@@ -67,12 +67,20 @@ __RCSID("$NetBSD: mv.c,v 1.44 2015/03/02 03:17:24 enami Exp $");
6767

6868
static int fflg, iflg, vflg;
6969
static int stdin_ok;
70+
static sig_atomic_t pinfo;
7071

7172
static int copy(char *, char *);
7273
static int do_move(char *, char *);
7374
static int fastcopy(char *, char *, struct stat *);
7475
__dead static void usage(void);
7576

77+
static void
78+
progress(int sig __unused)
79+
{
80+
81+
pinfo++;
82+
}
83+
7684
int
7785
main(int argc, char *argv[])
7886
{
@@ -109,6 +117,8 @@ main(int argc, char *argv[])
109117

110118
stdin_ok = isatty(STDIN_FILENO);
111119

120+
(void)signal(SIGINFO, progress);
121+
112122
/*
113123
* If the stat on the target fails or the target isn't a directory,
114124
* try the move. More than 2 arguments is an error in this case.
@@ -262,7 +272,9 @@ fastcopy(char *from, char *to, struct stat *sbp)
262272
#endif
263273
static blksize_t blen;
264274
static char *bp;
265-
int nread, from_fd, to_fd;
275+
int from_fd, to_fd;
276+
ssize_t nread;
277+
off_t total = 0;
266278

267279
if ((from_fd = open(from, O_RDONLY, 0)) < 0) {
268280
warn("%s", from);
@@ -281,11 +293,21 @@ fastcopy(char *from, char *to, struct stat *sbp)
281293
(void)close(to_fd);
282294
return (1);
283295
}
284-
while ((nread = read(from_fd, bp, blen)) > 0)
296+
while ((nread = read(from_fd, bp, blen)) > 0) {
285297
if (write(to_fd, bp, nread) != nread) {
286298
warn("%s", to);
287299
goto err;
288300
}
301+
total += nread;
302+
if (pinfo) {
303+
int pcent = (int)((100.0 * total) / sbp->st_size);
304+
305+
pinfo = 0;
306+
(void)fprintf(stderr, "%s => %s %llu/%llu bytes %d%% "
307+
"written\n", from, to, (unsigned long long)total,
308+
(unsigned long long)sbp->st_size, pcent);
309+
}
310+
}
289311
if (nread < 0) {
290312
warn("%s", from);
291313
err: if (unlink(to))

bin/pax/cpio.1

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.\" $NetBSD: cpio.1,v 1.13 2011/06/19 07:34:24 wiz Exp $
1+
.\" $NetBSD: cpio.1,v 1.14 2015/12/19 18:48:33 wiz Exp $
22
.\"
33
.\" Copyright (c) 1997 SigmaSoft, Th. Lockert
44
.\" All rights reserved.
@@ -297,7 +297,8 @@ specific archive format specification.
297297
.Xr pax 1 ,
298298
.Xr tar 1
299299
.Sh AUTHORS
300-
Keith Muller at the University of California, San Diego.
300+
.An Keith Muller
301+
at the University of California, San Diego.
301302
.Sh BUGS
302303
The
303304
.Fl s

0 commit comments

Comments
 (0)