FreeBSD Bugzilla – Attachment 7137 Details for
Bug 15690
savecore fails to work when it doesn't find the block-device
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.21 KB, created by
assar
on 1999-12-25 19:50:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
assar
Created:
1999-12-25 19:50:00 UTC
Size:
2.21 KB
patch
obsolete
>Index: savecore.c >=================================================================== >RCS file: /home/ncvs/src/sbin/savecore/savecore.c,v >retrieving revision 1.28 >diff -u -w -r1.28 savecore.c >--- savecore.c 1999/12/21 07:41:07 1.28 >+++ savecore.c 1999/12/25 19:36:31 >@@ -134,7 +134,6 @@ > void Lseek __P((int, off_t, int)); > int Open __P((const char *, int rw)); > int Read __P((int, void *, int)); >-char *rawname __P((char *s)); > void save_core __P((void)); > void usage __P((void)); > void Write __P((int, void *, int)); >@@ -340,7 +339,7 @@ > { > register FILE *fp; > register int bounds, ifd, nr, nw, ofd; >- char *rawp, path[MAXPATHLEN]; >+ char path[MAXPATHLEN]; > mode_t oumask; > > /* >@@ -379,15 +378,8 @@ > ofd = Create(path, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); > (void)umask(oumask); > >- /* Open the raw device. */ >- rawp = rawname(ddname); >- if ((ifd = open(rawp, O_RDONLY)) == -1) { >- syslog(LOG_WARNING, "%s: %m; using block device", rawp); >- ifd = dumpfd; >- } >- > /* Seek to the start of the core. */ >- Lseek(ifd, (off_t)dumplo, L_SET); >+ Lseek(dumpfd, (off_t)dumplo, L_SET); > > /* Copy the core file. */ > syslog(LOG_NOTICE, "writing %score to %s", >@@ -395,13 +387,13 @@ > for (; dumpsize > 0; dumpsize -= nr) { > (void)printf("%6dK\r", dumpsize / 1024); > (void)fflush(stdout); >- nr = read(ifd, buf, MIN(dumpsize, sizeof(buf))); >+ nr = read(dumpfd, buf, MIN(dumpsize, sizeof(buf))); > if (nr <= 0) { > if (nr == 0) > syslog(LOG_WARNING, > "WARNING: EOF on dump device"); > else >- syslog(LOG_ERR, "%s: %m", rawp); >+ syslog(LOG_ERR, "%s: %m", ddname); > goto err2; > } > if (compress) >@@ -417,7 +409,6 @@ > exit(1); > } > } >- (void)close(ifd); > if (compress) > (void)fclose(fp); > else >@@ -497,25 +488,6 @@ > closedir(dfd); > syslog(LOG_ERR, "can't find device %d/%d", major(dev), minor(dev)); > exit(1); >-} >- >-char * >-rawname(s) >- char *s; >-{ >- char *sl, name[MAXPATHLEN]; >- >- if ((sl = rindex(s, '/')) == NULL || sl[1] == '0') { >- syslog(LOG_ERR, >- "can't make raw dump device name from %s", s); >- return (s); >- } >- snprintf(name, sizeof(name), "%.*s/r%s", (int)(sl - s), s, sl + 1); >- if ((sl = strdup(name)) == NULL) { >- syslog(LOG_ERR, "%s", strerror(errno)); >- exit(1); >- } >- return (sl); > } > > int
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 15690
: 7137 |
7138