diffbuf_len += nbytes;
} while (nbytes == 1024);
diffbuf[diffbuf_len] = 0;
- pclose(fp);
+ if (pclose(fp) != 0) {
+ CtdlLogPrintf(CTDL_ERR, "pclose() returned an error - diff failed\n");
+ }
}
CtdlLogPrintf(CTDL_DEBUG, "diff length is %d bytes\n", diffbuf_len);
CtdlLogPrintf(CTDL_DEBUG, "callback found rev: %s\n", this_rev);
/* Perform the patch */
- fp = popen("patch -f -s -p0 >/dev/null 2>/dev/null", "w");
+ fp = popen("patch -f -s -p0 --global-reject-file=/dev/null >/dev/null 2>/dev/null", "w");
if (fp) {
/* Replace the filenames in the patch with the tempfilename we're actually tweaking */
fprintf(fp, "--- %s\n", hecbd->tempfilename);
}
}
} while ((*ptr != 0) && ((int)ptr < ((int)content + length)));
- pclose(fp);
+ if (pclose(fp) != 0) {
+ CtdlLogPrintf(CTDL_ERR, "pclose() returned an error - patch failed\n");
+ }
}
if (!strcasecmp(this_rev, hecbd->stop_when)) {