From 0ad12329a7a4dc89ae63e8b032badf559b4f5550 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 30 Jan 2021 14:21:49 +0100 Subject: get rid of plibc.h --- src/main/extractor_datasource.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/main/extractor_datasource.c') diff --git a/src/main/extractor_datasource.c b/src/main/extractor_datasource.c index 0b18d7c..9f51d90 100644 --- a/src/main/extractor_datasource.c +++ b/src/main/extractor_datasource.c @@ -229,7 +229,7 @@ bfds_pick_next_buffer_at (struct BufferedFileDataSource *bfds, bfds->buffer_pos = pos; return 0; } - position = (int64_t) LSEEK (bfds->fd, pos, SEEK_SET); + position = (int64_t) lseek (bfds->fd, pos, SEEK_SET); if (position < 0) { LOG_STRERROR ("lseek"); @@ -1214,38 +1214,38 @@ EXTRACTOR_datasource_create_from_file_ (const char *filename, winmode = O_BINARY; #endif - if (-1 == (fd = OPEN (filename, O_RDONLY | O_LARGEFILE | winmode))) + if (-1 == (fd = open (filename, O_RDONLY | O_LARGEFILE | winmode))) { LOG_STRERROR_FILE ("open", filename); return NULL; } - if ( (0 != FSTAT (fd, &sb)) || + if ( (0 != fstat (fd, &sb)) || (S_ISDIR (sb.st_mode)) ) { if (! S_ISDIR (sb.st_mode)) LOG_STRERROR_FILE ("fstat", filename); else LOG ("Skipping directory `%s'\n", filename); - (void) CLOSE (fd); + (void) close (fd); return NULL; } fsize = (int64_t) sb.st_size; if (0 == fsize) { - (void) CLOSE (fd); + (void) close (fd); return NULL; } bfds = bfds_new (NULL, fd, fsize); if (NULL == bfds) { - (void) CLOSE (fd); + (void) close (fd); return NULL; } if (NULL == (ds = malloc (sizeof (struct EXTRACTOR_Datasource)))) { LOG_STRERROR ("malloc"); bfds_delete (bfds); - (void) CLOSE (fd); + (void) close (fd); return NULL; } ds->bfds = bfds; @@ -1261,7 +1261,7 @@ EXTRACTOR_datasource_create_from_file_ (const char *filename, LOG ("Failed to initialize decompressor\n"); bfds_delete (bfds); free (ds); - (void) CLOSE (fd); + (void) close (fd); return NULL; } } @@ -1333,7 +1333,7 @@ EXTRACTOR_datasource_destroy_ (struct EXTRACTOR_Datasource *ds) cfs_destroy (ds->cfs); bfds_delete (ds->bfds); if (-1 != ds->fd) - (void) CLOSE (ds->fd); + (void) close (ds->fd); free (ds); } -- cgit v1.2.3