sdd.c (schily-2021-08-14.tar.bz2) | : | sdd.c (schily-2021-09-18.tar.bz2) | ||
---|---|---|---|---|
/* @(#)sdd.c 1.69 20/05/30 Copyright 1984-2020 J. Schilling */ | /* @(#)sdd.c 1.72 21/08/20 Copyright 1984-2021 J. Schilling */ | |||
#include <schily/mconfig.h> | #include <schily/mconfig.h> | |||
#ifndef lint | #ifndef lint | |||
static UConst char sccsid[] = | static UConst char sccsid[] = | |||
"@(#)sdd.c 1.69 20/05/30 Copyright 1984-2020 J. Schilling"; | "@(#)sdd.c 1.72 21/08/20 Copyright 1984-2021 J. Schilling"; | |||
#endif | #endif | |||
/* | /* | |||
* sdd Disk and Tape copy | * sdd Disk and Tape copy | |||
* | * | |||
* Large File remarks: | * Large File remarks: | |||
* | * | |||
* Even platforms without large file support don't limit the | * Even platforms without large file support don't limit the | |||
* amount of data that may be read/written to io-streams | * amount of data that may be read/written to io-streams | |||
* (e.g. stdin/stdout) and tapes. It makes no sense to use | * (e.g. stdin/stdout) and tapes. It makes no sense to use | |||
* off_t for several data types. As more platforms support long long | * off_t for several data types. As more platforms support long long | |||
* than large files, we use long long for several important | * than large files, we use long long for several important | |||
* variables that should not overflow. | * variables that should not overflow. | |||
* | * | |||
* Copyright (c) 1984-2020 J. Schilling | * Copyright (c) 1984-2021 J. Schilling | |||
*/ | */ | |||
/* | /* | |||
* The contents of this file are subject to the terms of the | * The contents of this file are subject to the terms of the | |||
* Common Development and Distribution License, Version 1.0 only | * Common Development and Distribution License, Version 1.0 only | |||
* (the "License"). You may not use this file except in compliance | * (the "License"). You may not use this file except in compliance | |||
* with the License. | * with the License. | |||
* | * | |||
* See the file CDDL.Schily.txt in this distribution for details. | * See the file CDDL.Schily.txt in this distribution for details. | |||
* A copy of the CDDL is also available via the Internet at | * A copy of the CDDL is also available via the Internet at | |||
* http://www.opensource.org/licenses/cddl1.txt | * http://www.opensource.org/licenses/cddl1.txt | |||
skipping to change at line 60 | skipping to change at line 60 | |||
#include <schily/stdio.h> | #include <schily/stdio.h> | |||
#include <schily/stdlib.h> | #include <schily/stdlib.h> | |||
#include <schily/unistd.h> | #include <schily/unistd.h> | |||
#include <schily/signal.h> | #include <schily/signal.h> | |||
#include <schily/utypes.h> | #include <schily/utypes.h> | |||
#include <schily/time.h> | #include <schily/time.h> | |||
#include <schily/standard.h> | #include <schily/standard.h> | |||
#include <schily/fcntl.h> | #include <schily/fcntl.h> | |||
#include <schily/string.h> | #include <schily/string.h> | |||
#define GT_COMERR /* #define comerr gtcomerr */ | ||||
#define GT_ERROR /* #define error gterror */ | ||||
#include <schily/schily.h> | #include <schily/schily.h> | |||
#include <schily/librmt.h> | #include <schily/librmt.h> | |||
#include <schily/errno.h> | #include <schily/errno.h> | |||
#include <schily/md5.h> | #include <schily/md5.h> | |||
#include <schily/nlsdefs.h> | ||||
#ifdef SIGRELSE | #ifdef SIGRELSE | |||
# define signal sigset /* reliable signal */ | # define signal sigset /* reliable signal */ | |||
#endif | #endif | |||
EXPORT int main __PR((int ac, char **av)); | EXPORT int main __PR((int ac, char **av)); | |||
LOCAL void set_signal __PR((int sig, RETSIGTYPE (*handler)(int))); | LOCAL void set_signal __PR((int sig, RETSIGTYPE (*handler)(int))); | |||
LOCAL void intr __PR((int sig)); | LOCAL void intr __PR((int sig)); | |||
LOCAL FILE *openfile __PR((char *name, char *mode)); | LOCAL FILE *openfile __PR((char *name, char *mode)); | |||
LOCAL char *memalloc __PR((long size)); | LOCAL char *memalloc __PR((long size)); | |||
skipping to change at line 432 | skipping to change at line 435 | |||
}; | }; | |||
EXPORT int | EXPORT int | |||
main(ac, av) | main(ac, av) | |||
int ac; | int ac; | |||
char *av[]; | char *av[]; | |||
{ | { | |||
int ret = 0; | int ret = 0; | |||
save_args(ac, av); | save_args(ac, av); | |||
(void) setlocale(LC_ALL, ""); | ||||
#ifdef USE_NLS | ||||
#if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */ | ||||
#define TEXT_DOMAIN "sdd" /* Use this only if it weren't */ | ||||
#endif | ||||
{ char *dir; | ||||
dir = searchfileinpath("share/locale", F_OK, | ||||
SIP_ANY_FILE|SIP_NO_PATH, NULL); | ||||
if (dir) | ||||
(void) bindtextdomain(TEXT_DOMAIN, dir); | ||||
else | ||||
#if defined(PROTOTYPES) && defined(INS_BASE) | ||||
(void) bindtextdomain(TEXT_DOMAIN, INS_BASE "/share/locale"); | ||||
#else | ||||
(void) bindtextdomain(TEXT_DOMAIN, "/usr/share/locale"); | ||||
#endif | ||||
(void) textdomain(TEXT_DOMAIN); | ||||
} | ||||
#endif /* USE_NLS */ | ||||
getopts(ac, av); | getopts(ac, av); | |||
tty = stdin; | tty = stdin; | |||
getstarttime(); | getstarttime(); | |||
if (signal(SIGINT, SIG_IGN) != SIG_IGN) | if (signal(SIGINT, SIG_IGN) != SIG_IGN) | |||
(void) set_signal(SIGINT, intr); | (void) set_signal(SIGINT, intr); | |||
#ifdef SIGQUIT | #ifdef SIGQUIT | |||
if (signal(SIGQUIT, SIG_IGN) != SIG_IGN) | if (signal(SIGQUIT, SIG_IGN) != SIG_IGN) | |||
(void) set_signal(SIGQUIT, intr); | (void) set_signal(SIGQUIT, intr); | |||
#endif | #endif | |||
skipping to change at line 1478 | skipping to change at line 1503 | |||
&nullout, | &nullout, | |||
#endif | #endif | |||
&help, &prvers, | &help, &prvers, | |||
&debug, &showtime, &showtime) < 0) { | &debug, &showtime, &showtime) < 0) { | |||
errmsgno(EX_BAD, "Bad Option: '%s'\n", cav[0]); | errmsgno(EX_BAD, "Bad Option: '%s'\n", cav[0]); | |||
usage(EX_BAD); | usage(EX_BAD); | |||
} | } | |||
if (help) | if (help) | |||
usage(0); | usage(0); | |||
if (prvers) { | if (prvers) { | |||
printf("sdd %s %s (%s-%s-%s)\n\n", "1.69", "2020/05/30", | gtprintf("sdd %s %s (%s-%s-%s)\n\n", "1.72", "2021/08/20", | |||
HOST_CPU, HOST_VENDOR, HOST_OS); | HOST_CPU, HOST_VENDOR, HOST_OS); | |||
printf("Copyright (C) 1984-2020 Jörg Schilling\n"); | gtprintf("Copyright (C) 1984-2021 %s\n", _("Jörg Schilling")); | |||
printf("This is free software; see the source for copying "); | gtprintf("This is free software; see the source for copying "); | |||
printf("conditions. There is NO\n"); | gtprintf("conditions. There is NO\n"); | |||
printf("warranty; not even for MERCHANTABILITY or "); | gtprintf("warranty; not even for MERCHANTABILITY or "); | |||
printf("FITNESS FOR A PARTICULAR PURPOSE.\n"); | gtprintf("FITNESS FOR A PARTICULAR PURPOSE.\n"); | |||
exit(0); | exit(0); | |||
} | } | |||
cac = ac - 1; | cac = ac - 1; | |||
cav = av + 1; | cav = av + 1; | |||
if (getfiles(&cac, &cav, opts) != 0) { | if (getfiles(&cac, &cav, opts) != 0) { | |||
errmsgno(EX_BAD, "Bad Argument: '%s'\n", cav[0]); | errmsgno(EX_BAD, "Bad Argument: '%s'\n", cav[0]); | |||
usage(EX_BAD); | usage(EX_BAD); | |||
} | } | |||
iseek = (off_t)lliseek; | iseek = (off_t)lliseek; | |||
End of changes. 8 change blocks. | ||||
9 lines changed or deleted | 34 lines changed or added |