savecore(8): Use the buf's size and not char *'s size for reading the kernel.
authorSascha Wildner <saw@online.de>
Sat, 16 Jun 2012 23:42:28 +0000 (01:42 +0200)
committerSascha Wildner <saw@online.de>
Sat, 16 Jun 2012 23:43:00 +0000 (01:43 +0200)
This speeds up the kernel saving part by a couple of seconds.

sbin/savecore/savecore.c

index 56562a0..5c69954 100644 (file)
@@ -402,7 +402,7 @@ DoFile(const char *savedir, const char *device)
        syslog(LOG_NOTICE, "writing %skernel to %s",
            compress ? "compressed " : "", buf);
 
-       while ((nr = read(fdkernin, buf, sizeof(buf))) > 0) {
+       while ((nr = read(fdkernin, buf, BUFFERSIZE)) > 0) {
                nw = fwrite(buf, 1, nr, fpkern);
                if (nw != nr) {
                        syslog(LOG_ERR, "kern.%d: %m", bounds);