0004-Some-minor-style-and-bug-fixes-from-FreeBSD.patch

eadler, 04/26/2013 11:01 AM

Download (1.52 KB)

View differences:

bin/rm/rm.c
42 42
#include <fts.h>
43 43
#include <grp.h>
44 44
#include <pwd.h>
45
#include <stdint.h>
45 46
#include <signal.h>
46 47
#include <stdio.h>
47 48
#include <stdlib.h>
......
52 53
static int dflag, eval, fflag, iflag, Pflag, vflag, Wflag, stdin_ok;
53 54
static int rflag, Iflag, xflag;
54 55
static uid_t uid;
55
volatile sig_atomic_t info;
56
static volatile sig_atomic_t info;
56 57

  
57 58
static int	check(const char *, const char *, struct stat *);
58 59
static int	check2(char **);
......
203 204
	if ((fts = fts_open(argv, flags, NULL)) == NULL) {
204 205
		if (fflag && errno == ENOENT)
205 206
			return;
206
		err(1, NULL);
207
		err(1, "fts_open");
207 208
	}
208 209
	while ((p = fts_read(fts)) != NULL) {
209 210
		switch (p->fts_info) {
......
366 367
		if (!fflag && !S_ISWHT(sb.st_mode) && !check(f, f, &sb))
367 368
			continue;
368 369
		rval = 0;
369
		if (!uid &&
370
		if (!uid && !S_ISWHT(sb.st_mode) &&
370 371
		    (sb.st_flags & (UF_APPEND|UF_IMMUTABLE)) &&
371 372
		    !(sb.st_flags & (SF_APPEND|SF_IMMUTABLE)))
372 373
			rval = lchflags(f, sb.st_flags & ~(UF_APPEND|UF_IMMUTABLE));
......
633 634
static void
634 635
siginfo(int notused __unused)
635 636
{
637

  
636 638
	info = 1;
637 639
}
638
-