FreeBSD Bugzilla – Attachment 9686 Details for
Bug 19748
fetch -o will unlink special files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.25 KB, created by
lyonsm
on 2000-07-07 08:30:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
lyonsm
Created:
2000-07-07 08:30:01 UTC
Size:
1.25 KB
patch
obsolete
>*** util.c.orig Thu Jul 6 23:08:10 2000 >--- util.c Thu Jul 6 23:23:53 2000 >*************** >*** 29,36 **** >--- 29,37 ---- > * $FreeBSD: src/usr.bin/fetch/util.c,v 1.7 1999/08/28 01:00:52 peter Exp $ > */ > > #include <sys/types.h> >+ #include <sys/stat.h> > > #include <ctype.h> > #include <err.h> > #include <errno.h> >*************** >*** 104,117 **** > } > > /* > * Delete the file when exiting on error, if it is not `precious'. > */ > void > rm(struct fetch_state *fs) > { > if (!(fs->fs_outputfile[0] == '-' && fs->fs_outputfile[1] == '\0')) { >! if (!fs->fs_restart && !fs->fs_mirror && !fs->fs_precious) > unlink(fs->fs_outputfile); > else > adjmodtime(fs); > } >--- 105,126 ---- > } > > /* > * Delete the file when exiting on error, if it is not `precious'. >+ * Files which exist and are not plain files are automatically considered >+ * precious. > */ > void > rm(struct fetch_state *fs) > { >+ int precious = fs->fs_precious; >+ struct stat sb; >+ >+ if(lstat(fs->fs_outputfile, &sb)) return; >+ if((sb.st_mode & S_IFMT) != S_IFREG) precious = 1; >+ > if (!(fs->fs_outputfile[0] == '-' && fs->fs_outputfile[1] == '\0')) { >! if (!fs->fs_restart && !fs->fs_mirror && !precious) > unlink(fs->fs_outputfile); > else > adjmodtime(fs); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 19748
: 9686