savecore.c (120907) | savecore.c (126042) |
---|---|
1/*- 2 * Copyright (c) 2002 Poul-Henning Kamp 3 * Copyright (c) 2002 Networks Associates Technology, Inc. 4 * All rights reserved. 5 * 6 * This software was developed for the FreeBSD Project by Poul-Henning Kamp 7 * and NAI Labs, the Security Research Division of Network Associates, Inc. 8 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the --- 51 unchanged lines hidden (view full) --- 60 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 61 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 62 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 63 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 64 * SUCH DAMAGE. 65 */ 66 67#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2002 Poul-Henning Kamp 3 * Copyright (c) 2002 Networks Associates Technology, Inc. 4 * All rights reserved. 5 * 6 * This software was developed for the FreeBSD Project by Poul-Henning Kamp 7 * and NAI Labs, the Security Research Division of Network Associates, Inc. 8 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the --- 51 unchanged lines hidden (view full) --- 60 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 61 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 62 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 63 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 64 * SUCH DAMAGE. 65 */ 66 67#include <sys/cdefs.h> |
68__FBSDID("$FreeBSD: head/sbin/savecore/savecore.c 120907 2003-10-08 07:37:11Z marcel $"); | 68__FBSDID("$FreeBSD: head/sbin/savecore/savecore.c 126042 2004-02-20 12:22:52Z tjr $"); |
69 70#include <sys/param.h> 71#include <sys/disk.h> 72#include <sys/kerneldump.h> 73#include <sys/param.h> 74#include <sys/mount.h> 75#include <sys/stat.h> 76#include <errno.h> --- 340 unchanged lines hidden (view full) --- 417 * nw <= hs <= he <= nr 418 * If hs > nw, buf[nw..hs] contains non-zero data. 419 * If he > hs, buf[hs..he] is all zeroes. 420 */ 421 if (hs > nw) 422 if (fwrite(buf + nw, hs - nw, 1, fp) != 1) 423 break; 424 if (he > hs) | 69 70#include <sys/param.h> 71#include <sys/disk.h> 72#include <sys/kerneldump.h> 73#include <sys/param.h> 74#include <sys/mount.h> 75#include <sys/stat.h> 76#include <errno.h> --- 340 unchanged lines hidden (view full) --- 417 * nw <= hs <= he <= nr 418 * If hs > nw, buf[nw..hs] contains non-zero data. 419 * If he > hs, buf[hs..he] is all zeroes. 420 */ 421 if (hs > nw) 422 if (fwrite(buf + nw, hs - nw, 1, fp) != 1) 423 break; 424 if (he > hs) |
425 if (fseek(fp, he - hs, SEEK_CUR) == -1) | 425 if (fseeko(fp, he - hs, SEEK_CUR) == -1) |
426 break; 427 } 428 } 429 if (nw != wl) { 430 syslog(LOG_ERR, 431 "write error on vmcore.%d file: %m", bounds); 432 syslog(LOG_WARNING, 433 "WARNING: vmcore may be incomplete"); --- 137 unchanged lines hidden --- | 426 break; 427 } 428 } 429 if (nw != wl) { 430 syslog(LOG_ERR, 431 "write error on vmcore.%d file: %m", bounds); 432 syslog(LOG_WARNING, 433 "WARNING: vmcore may be incomplete"); --- 137 unchanged lines hidden --- |