From: nasm-bot f. H. P. A. <hp...@li...> - 2016-05-17 04:18:16
|
Commit-ID: c0aaf9750f1d75e5472e9ce2e7b6a64133eb8f73 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=c0aaf9750f1d75e5472e9ce2e7b6a64133eb8f73 Author: H. Peter Anvin <hp...@li...> AuthorDate: Tue, 10 May 2016 15:18:00 -0700 Committer: H. Peter Anvin <hp...@li...> CommitDate: Tue, 10 May 2016 15:18:00 -0700 Revert "nasmlib/file.c: Windows _chsize_s() *returns* errno" This reverts commit 55e51d9534a547c7bd4148d952b317884991078e. First of all, _chsize_s() *does* set errno, even though it returns the same value. Second of all, all we look for is a zero return value anyway, so there is no need for this wrapper. Signed-off-by: H. Peter Anvin <hp...@li...> --- nasmlib/file.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/nasmlib/file.c b/nasmlib/file.c index ce22ea3..6ba3844 100644 --- a/nasmlib/file.c +++ b/nasmlib/file.c @@ -60,17 +60,7 @@ /* Can we adjust the file size without actually writing all the bytes? */ #ifdef HAVE_FILENO /* Useless without fileno() */ # ifdef HAVE__CHSIZE_S -static int nasm_ftruncate(int fd, int64_t size) -{ - int err = _chsize_s(fd, size); - - if (!err) - return 0; - - errno = err; - return -1; -} -# define nasm_ftruncate(fd,size) nasm_ftruncate(fd,size) +# define nasm_ftruncate(fd,size) _chsize_s(fd,size) # elif defined(HAVE__CHSIZE) # define nasm_ftruncate(fd,size) _chsize(fd,size) # elif defined(HAVE_FTRUNCATE) |