aboutsummaryrefslogtreecommitdiffstats
path: root/com32/gpllib/disk
diff options
context:
space:
mode:
authorPierre-Alexandre Meyer <pierre@mouraf.org>2009-08-05 15:09:47 -0700
committerPierre-Alexandre Meyer <pierre@mouraf.org>2009-08-05 15:09:47 -0700
commit2acba746d510b460fffd29ec5538962fec3cebda (patch)
tree31c0958c4adce9ce01f86bee69c26b001a498d22 /com32/gpllib/disk
parent724c1ef7714087cf643bb0b34f92f09eca8c8d39 (diff)
downloadsyslinux-2acba746d510b460fffd29ec5538962fec3cebda.tar.gz
syslinux-2acba746d510b460fffd29ec5538962fec3cebda.tar.xz
syslinux-2acba746d510b460fffd29ec5538962fec3cebda.zip
gpllib: More errno fixes
* Fix header files due to previous commit * Prefix disk errnos with ED to avoid conflicts with classic errno * Fix swsusp code to use errno_disk Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Diffstat (limited to 'com32/gpllib/disk')
-rw-r--r--com32/gpllib/disk/error.c2
-rw-r--r--com32/gpllib/disk/swsusp.c16
2 files changed, 7 insertions, 11 deletions
diff --git a/com32/gpllib/disk/error.c b/com32/gpllib/disk/error.c
index 5491b994..2b82c359 100644
--- a/com32/gpllib/disk/error.c
+++ b/com32/gpllib/disk/error.c
@@ -20,5 +20,5 @@
**/
void get_error(void* buffer_ptr)
{
- sprintf(buffer_ptr, "Disklib: error %d\n", errno_disk);
+ snprintf(buffer_ptr, MAX_DISK_ERRNO, "Disklib: error %d\n", errno_disk);
}
diff --git a/com32/gpllib/disk/swsusp.c b/com32/gpllib/disk/swsusp.c
index f627aca4..ac9724aa 100644
--- a/com32/gpllib/disk/swsusp.c
+++ b/com32/gpllib/disk/swsusp.c
@@ -9,23 +9,19 @@
* swsusp_check - check if a (swap) partition contains the swsusp signature
* @drive_info: driveinfo struct describing the disk containing the partition
* @ptab; Partition table of the partition
- * @error: Return the error code on failure
**/
-int swsusp_check(struct driveinfo *drive_info, struct part_entry *ptab, int *error)
+int swsusp_check(struct driveinfo *drive_info, struct part_entry *ptab)
{
- struct swsusp_header *header_p;
+ struct swsusp_header header_p;
int offset;
int found;
/* Read first page of the swap device */
offset = ptab->start_lba;
- header_p = (struct swsusp_header *) read_sectors(drive_info, offset, PAGE_SIZE/SECTOR, error);
-
- if (!header_p)
- return -1; /* The error code has been stored in `error' */
- else {
- found = !memcmp(SWSUSP_SIG, header_p->sig, 10);
- free(header_p);
+ if (read_sectors(drive_info, &header_p, offset, PAGE_SIZE/SECTOR) == -1) {
+ return -1;
+ } else {
+ found = !memcmp(SWSUSP_SIG, header_p.sig, 10);
return found;
}
}