Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:yan_gao:branches:network:ha-clustering:Factory:Test:Test
libqb
bsc#1193737-0001-Revert-unix.c-use-posix_falloc...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bsc#1193737-0001-Revert-unix.c-use-posix_fallocate-409.patch of Package libqb
From c1189ca1a06bda6e13c1fff4b812cd13f61a5683 Mon Sep 17 00:00:00 2001 From: "Gao,Yan" <ygao@suse.com> Date: Wed, 5 Jan 2022 13:45:25 +0100 Subject: [PATCH] Revert "unix.c: use posix_fallocate() (#409)" This reverts commit 1c6229c171b7b8e608377ff9ee42a1216afd528d. --- configure.ac | 2 +- lib/unix.c | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/configure.ac b/configure.ac index c6ece26..ff20e5f 100644 --- a/configure.ac +++ b/configure.ac @@ -259,7 +259,7 @@ AC_FUNC_CHOWN AC_FUNC_FORK AC_FUNC_MMAP AC_FUNC_STRERROR_R -AC_CHECK_FUNCS([alarm fsync fdatasync ftruncate posix_fallocate \ +AC_CHECK_FUNCS([alarm fsync fdatasync ftruncate \ gettimeofday localtime localtime_r \ memset munmap socket \ strchr strrchr strdup strstr strcasecmp \ diff --git a/lib/unix.c b/lib/unix.c index 2fb53d0..4ef914f 100644 --- a/lib/unix.c +++ b/lib/unix.c @@ -26,9 +26,6 @@ #ifdef HAVE_SYS_MMAN_H #include <sys/mman.h> #endif -#if defined(HAVE_FCNTL_H) && defined(HAVE_POSIX_FALLOCATE) -#include <fcntl.h> -#endif #include "util_int.h" #include <qb/qbdefs.h> @@ -75,11 +72,9 @@ qb_sys_mmap_file_open(char *path, const char *file, size_t bytes, { int32_t fd; int32_t res = 0; -#ifndef HAVE_POSIX_FALLOCATE ssize_t written; char *buffer = NULL; int32_t i; -#endif char *is_absolute = strchr(file, '/'); if (is_absolute) { @@ -120,14 +115,6 @@ qb_sys_mmap_file_open(char *path, const char *file, size_t bytes, goto unlink_exit; } #endif -#ifdef HAVE_POSIX_FALLOCATE - if ((res = posix_fallocate(fd, 0, bytes)) != 0) { - errno = res; - res = -1 * res; - qb_util_perror(LOG_ERR, "couldn't allocate file %s", path); - goto unlink_exit; - } -#else if (file_flags & O_CREAT) { long page_size = sysconf(_SC_PAGESIZE); long write_size = QB_MIN(page_size, bytes); @@ -154,7 +141,6 @@ retry_write: } free(buffer); } -#endif /* HAVE_POSIX_FALLOCATE */ return fd; -- 2.31.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor