Print this page
1150 libcmdutils has superfluous #define
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Reviewed by: Marcel Telka <marcel@telka.sk>
*** 35,46 ****
* University Acknowledgment- Portions of this document are derived from
* software developed by the University of California, Berkeley, and its
* contributors.
*/
- #pragma ident "%Z%%M% %I% %E% SMI"
-
#include "libcmdutils.h"
int
writefile(int fi, int fo, char *infile, char *outfile, char *asfile,
--- 35,44 ----
*** 96,106 ****
outfile, dgettext(TEXT_DOMAIN, " attribute "), atfile);
} else {
(void) snprintf(targbuf, targ_size, "%s", outfile);
}
! if (ISREG(*s1p) && s1p->st_size > SMALLFILESIZE) {
/*
* Determine size of initial mapping. This will determine the
* size of the address space chunk we work with. This initial
* mapping size will be used to perform munmap() in the future.
*/
--- 94,104 ----
outfile, dgettext(TEXT_DOMAIN, " attribute "), atfile);
} else {
(void) snprintf(targbuf, targ_size, "%s", outfile);
}
! if (S_ISREG(s1p->st_mode) && s1p->st_size > SMALLFILESIZE) {
/*
* Determine size of initial mapping. This will determine the
* size of the address space chunk we work with. This initial
* mapping size will be used to perform munmap() in the future.
*/
*** 138,148 ****
else
perror(srcbuf);
(void) close(fi);
(void) close(fo);
(void) munmap(cp, munmapsize);
! if (ISREG(*s2p))
(void) unlink(targbuf);
return (1);
}
remains -= nbytes;
if (remains == 0)
--- 136,146 ----
else
perror(srcbuf);
(void) close(fi);
(void) close(fo);
(void) munmap(cp, munmapsize);
! if (S_ISREG(s2p->st_mode))
(void) unlink(targbuf);
return (1);
}
remains -= nbytes;
if (remains == 0)
*** 162,172 ****
else
perror(targbuf);
(void) close(fi);
(void) close(fo);
(void) munmap(cp, munmapsize);
! if (ISREG(*s2p))
(void) unlink(targbuf);
if (srcbuf != NULL)
free(srcbuf);
if (targbuf != NULL)
free(targbuf);
--- 160,170 ----
else
perror(targbuf);
(void) close(fi);
(void) close(fo);
(void) munmap(cp, munmapsize);
! if (S_ISREG(s2p->st_mode))
(void) unlink(targbuf);
if (srcbuf != NULL)
free(srcbuf);
if (targbuf != NULL)
free(targbuf);
*** 182,192 ****
MAP_FIXED, fi, offset) == MAP_FAILED) {
perror(srcbuf);
(void) close(fi);
(void) close(fo);
(void) munmap(cp, munmapsize);
! if (ISREG(*s2p))
(void) unlink(targbuf);
if (srcbuf != NULL)
free(srcbuf);
if (targbuf != NULL)
free(targbuf);
--- 180,190 ----
MAP_FIXED, fi, offset) == MAP_FAILED) {
perror(srcbuf);
(void) close(fi);
(void) close(fo);
(void) munmap(cp, munmapsize);
! if (S_ISREG(s2p->st_mode))
(void) unlink(targbuf);
if (srcbuf != NULL)
free(srcbuf);
if (targbuf != NULL)
free(targbuf);
*** 201,221 ****
if (n == 0) {
return (0);
} else if (n < 0) {
(void) close(fi);
(void) close(fo);
! if (ISREG(*s2p))
(void) unlink(targbuf);
if (srcbuf != NULL)
free(srcbuf);
if (targbuf != NULL)
free(targbuf);
return (1);
} else if (write(fo, buf, n) != n) {
(void) close(fi);
(void) close(fo);
! if (ISREG(*s2p))
(void) unlink(targbuf);
if (srcbuf != NULL)
free(srcbuf);
if (targbuf != NULL)
free(targbuf);
--- 199,219 ----
if (n == 0) {
return (0);
} else if (n < 0) {
(void) close(fi);
(void) close(fo);
! if (S_ISREG(s2p->st_mode))
(void) unlink(targbuf);
if (srcbuf != NULL)
free(srcbuf);
if (targbuf != NULL)
free(targbuf);
return (1);
} else if (write(fo, buf, n) != n) {
(void) close(fi);
(void) close(fo);
! if (S_ISREG(s2p->st_mode))
(void) unlink(targbuf);
if (srcbuf != NULL)
free(srcbuf);
if (targbuf != NULL)
free(targbuf);