diff options
| author | Eli Zaretskii | 2005-10-20 13:59:31 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2005-10-20 13:59:31 +0000 |
| commit | 1ec324f3bbdea8288f6024dfd5a77bfc6e90b2da (patch) | |
| tree | 6e09708d0debec00f01d33de1cf0740308b68bd8 /src | |
| parent | 098767d9432fe936187ef24572502261351be734 (diff) | |
| download | emacs-1ec324f3bbdea8288f6024dfd5a77bfc6e90b2da.tar.gz emacs-1ec324f3bbdea8288f6024dfd5a77bfc6e90b2da.zip | |
(unexec): Fix calls to `fatal' with less than 3 arguments.
Diffstat (limited to 'src')
| -rw-r--r-- | src/unexelf.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/unexelf.c b/src/unexelf.c index e33a9a1aeb3..f50e849fdcf 100644 --- a/src/unexelf.c +++ b/src/unexelf.c | |||
| @@ -702,7 +702,7 @@ unexec (new_name, old_name, data_start, bss_start, entry_address) | |||
| 702 | #if MAP_ANON == 0 | 702 | #if MAP_ANON == 0 |
| 703 | mmap_fd = open ("/dev/zero", O_RDONLY); | 703 | mmap_fd = open ("/dev/zero", O_RDONLY); |
| 704 | if (mmap_fd < 0) | 704 | if (mmap_fd < 0) |
| 705 | fatal ("Can't open /dev/zero for reading: errno %d\n", errno); | 705 | fatal ("Can't open /dev/zero for reading: errno %d\n", errno, 0); |
| 706 | #endif | 706 | #endif |
| 707 | 707 | ||
| 708 | /* We cannot use malloc here because that may use sbrk. If it does, | 708 | /* We cannot use malloc here because that may use sbrk. If it does, |
| @@ -713,7 +713,7 @@ unexec (new_name, old_name, data_start, bss_start, entry_address) | |||
| 713 | old_base = mmap (NULL, old_file_size, PROT_READ | PROT_WRITE, | 713 | old_base = mmap (NULL, old_file_size, PROT_READ | PROT_WRITE, |
| 714 | MAP_ANON | MAP_PRIVATE, mmap_fd, 0); | 714 | MAP_ANON | MAP_PRIVATE, mmap_fd, 0); |
| 715 | if (old_base == MAP_FAILED) | 715 | if (old_base == MAP_FAILED) |
| 716 | fatal ("Can't allocate buffer for %s\n", old_name); | 716 | fatal ("Can't allocate buffer for %s\n", old_name, 0); |
| 717 | 717 | ||
| 718 | if (read (old_file, old_base, stat_buf.st_size) != stat_buf.st_size) | 718 | if (read (old_file, old_base, stat_buf.st_size) != stat_buf.st_size) |
| 719 | fatal ("Didn't read all of %s: errno %d\n", old_name, errno); | 719 | fatal ("Didn't read all of %s: errno %d\n", old_name, errno); |
| @@ -802,7 +802,7 @@ unexec (new_name, old_name, data_start, bss_start, entry_address) | |||
| 802 | new_base = mmap (NULL, new_file_size, PROT_READ | PROT_WRITE, | 802 | new_base = mmap (NULL, new_file_size, PROT_READ | PROT_WRITE, |
| 803 | MAP_ANON | MAP_PRIVATE, mmap_fd, 0); | 803 | MAP_ANON | MAP_PRIVATE, mmap_fd, 0); |
| 804 | if (new_base == MAP_FAILED) | 804 | if (new_base == MAP_FAILED) |
| 805 | fatal ("Can't allocate buffer for %s\n", old_name); | 805 | fatal ("Can't allocate buffer for %s\n", old_name, 0); |
| 806 | 806 | ||
| 807 | new_file_h = (ElfW(Ehdr) *) new_base; | 807 | new_file_h = (ElfW(Ehdr) *) new_base; |
| 808 | new_program_h = (ElfW(Phdr) *) ((byte *) new_base + old_file_h->e_phoff); | 808 | new_program_h = (ElfW(Phdr) *) ((byte *) new_base + old_file_h->e_phoff); |
| @@ -1079,7 +1079,7 @@ unexec (new_name, old_name, data_start, bss_start, entry_address) | |||
| 1079 | && old_mdebug_index != -1) | 1079 | && old_mdebug_index != -1) |
| 1080 | { | 1080 | { |
| 1081 | int diff = NEW_SECTION_H(nn).sh_offset | 1081 | int diff = NEW_SECTION_H(nn).sh_offset |
| 1082 | - OLD_SECTION_H(old_mdebug_index).sh_offset; | 1082 | - OLD_SECTION_H(old_mdebug_index).sh_offset; |
| 1083 | HDRR *phdr = (HDRR *)(NEW_SECTION_H (nn).sh_offset + new_base); | 1083 | HDRR *phdr = (HDRR *)(NEW_SECTION_H (nn).sh_offset + new_base); |
| 1084 | 1084 | ||
| 1085 | if (diff) | 1085 | if (diff) |
| @@ -1257,9 +1257,13 @@ unexec (new_name, old_name, data_start, bss_start, entry_address) | |||
| 1257 | /* Write out new_file, and free the buffers. */ | 1257 | /* Write out new_file, and free the buffers. */ |
| 1258 | 1258 | ||
| 1259 | if (write (new_file, new_base, new_file_size) != new_file_size) | 1259 | if (write (new_file, new_base, new_file_size) != new_file_size) |
| 1260 | #ifndef emacs | ||
| 1261 | fatal ("Didn't write %d bytes: errno %d\n", | ||
| 1262 | new_file_size, errno); | ||
| 1263 | #else | ||
| 1260 | fatal ("Didn't write %d bytes to %s: errno %d\n", | 1264 | fatal ("Didn't write %d bytes to %s: errno %d\n", |
| 1261 | new_file_size, new_base, errno); | 1265 | new_file_size, new_base, errno); |
| 1262 | 1266 | #endif | |
| 1263 | munmap (old_base, old_file_size); | 1267 | munmap (old_base, old_file_size); |
| 1264 | munmap (new_base, new_file_size); | 1268 | munmap (new_base, new_file_size); |
| 1265 | 1269 | ||