cmp.c (0b8224d1cc9dc6c9778ba04a75b2c8d47e5d7481) cmp.c (d350e8d795d53dbc58ea428f76355cf5e28f6116)
1/*
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 1987, 1990, 1993, 1994
5 * The Regents of the University of California. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 24 unchanged lines hidden (view full) ---

33#include <sys/stat.h>
34
35#include <capsicum_helpers.h>
36#include <err.h>
37#include <errno.h>
38#include <fcntl.h>
39#include <getopt.h>
40#include <nl_types.h>
1/*
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 1987, 1990, 1993, 1994
5 * The Regents of the University of California. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 24 unchanged lines hidden (view full) ---

33#include <sys/stat.h>
34
35#include <capsicum_helpers.h>
36#include <err.h>
37#include <errno.h>
38#include <fcntl.h>
39#include <getopt.h>
40#include <nl_types.h>
41#include <stdbool.h>
41#include <stdio.h>
42#include <stdlib.h>
43#include <string.h>
44#include <unistd.h>
45
46#include <libutil.h>
47
48#include "extern.h"

--- 12 unchanged lines hidden (view full) ---

61};
62
63#ifdef SIGINFO
64volatile sig_atomic_t info;
65
66static void
67siginfo(int signo)
68{
42#include <stdio.h>
43#include <stdlib.h>
44#include <string.h>
45#include <unistd.h>
46
47#include <libutil.h>
48
49#include "extern.h"

--- 12 unchanged lines hidden (view full) ---

62};
63
64#ifdef SIGINFO
65volatile sig_atomic_t info;
66
67static void
68siginfo(int signo)
69{
69
70 info = signo;
71}
72#endif
73
74static void usage(void) __dead2;
75
76static bool
77parse_iskipspec(char *spec, off_t *skip1, off_t *skip2)

--- 161 unchanged lines hidden (view full) ---

239#ifdef SIGINFO
240 (void)signal(SIGINFO, siginfo);
241#endif
242 if (special)
243 c_special(fd1, file1, skip1, fd2, file2, skip2, limit);
244 else {
245 if (zflag && sb1.st_size != sb2.st_size) {
246 if (!sflag)
70 info = signo;
71}
72#endif
73
74static void usage(void) __dead2;
75
76static bool
77parse_iskipspec(char *spec, off_t *skip1, off_t *skip2)

--- 161 unchanged lines hidden (view full) ---

239#ifdef SIGINFO
240 (void)signal(SIGINFO, siginfo);
241#endif
242 if (special)
243 c_special(fd1, file1, skip1, fd2, file2, skip2, limit);
244 else {
245 if (zflag && sb1.st_size != sb2.st_size) {
246 if (!sflag)
247 (void) printf("%s %s differ: size\n",
247 (void)printf("%s %s differ: size\n",
248 file1, file2);
249 exit(DIFF_EXIT);
250 }
251 c_regular(fd1, file1, skip1, sb1.st_size,
252 fd2, file2, skip2, sb2.st_size, limit);
253 }
254 exit(0);
255}
256
257static void
258usage(void)
259{
260
261 (void)fprintf(stderr,
262 "usage: cmp [-l | -s | -x] [-hz] file1 file2 [skip1 [skip2]]\n");
263 exit(ERR_EXIT);
264}
248 file1, file2);
249 exit(DIFF_EXIT);
250 }
251 c_regular(fd1, file1, skip1, sb1.st_size,
252 fd2, file2, skip2, sb2.st_size, limit);
253 }
254 exit(0);
255}
256
257static void
258usage(void)
259{
260
261 (void)fprintf(stderr,
262 "usage: cmp [-l | -s | -x] [-hz] file1 file2 [skip1 [skip2]]\n");
263 exit(ERR_EXIT);
264}