wok-next diff syslinux/stuff/iso2exe/iso2exe.c @ rev 18783

syslinux: set tz command line argument
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Jan 03 13:17:18 2016 +0100 (2016-01-03)
parents d334cc1613e2
children ee7f5b80836f
line diff
     1.1 --- a/syslinux/stuff/iso2exe/iso2exe.c	Fri Jan 01 23:25:32 2016 +0100
     1.2 +++ b/syslinux/stuff/iso2exe/iso2exe.c	Sun Jan 03 13:17:18 2016 +0100
     1.3 @@ -10,7 +10,12 @@
     1.4  #include <windows.h>
     1.5  #endif
     1.6  #ifdef __MSDOS__
     1.7 -#define ftruncate(a,b)
     1.8 +int ftruncate(int fd, long newsize)
     1.9 +{
    1.10 +	if (lseek(fd, newsize, SEEK_SET) != -1L)
    1.11 +		return write(fd, NULL, 0);
    1.12 +	return -1;
    1.13 +}
    1.14  #endif
    1.15  #ifdef __MINGW32__
    1.16  #define ftruncate chsize
    1.17 @@ -263,12 +268,13 @@
    1.18  	}
    1.19  }
    1.20  
    1.21 -static void clear_config(unsigned i)
    1.22 +static unsigned clear_config(unsigned i)
    1.23  {
    1.24  	for (;i % 512; i++) {
    1.25  		/* clear custom config */
    1.26  		write(fd, buffer + 2048, 2048);
    1.27  	}
    1.28 +	return i;
    1.29  }
    1.30  
    1.31  static unsigned install(char *filename)
    1.32 @@ -309,7 +315,7 @@
    1.33  		}
    1.34  		i = getcustomsector();
    1.35  		lseek(fd, i * 2048UL, SEEK_SET);
    1.36 -		clear_config(i);
    1.37 +		i = clear_config(i);
    1.38  		ftruncate(fd, i * 2048UL);
    1.39  		close(fd);
    1.40  		status = 0;