Просмотр исходного кода

libdpkg: Fix fd_allocate_size() function to build on Mac OS X

Add missing semicolons to fcntl() call, and rename fs_preallocate_setup()
call sites to fd_preallocate_setup() on Mac OS X codepath.

Regression introduced in commit 87b0b20b86407baf1deb4e91b3fd839e01228ac8.

Reported-by: Dominyk Tiller <dominyktiller@gmail.com>
Guillem Jover лет назад: 11
Родитель
Сommit
bd3f720ca0
2 измененных файлов с 6 добавлено и 4 удалено
  1. 2 0
      debian/changelog
  2. 4 4
      lib/dpkg/fdio.c

+ 2 - 0
debian/changelog

@@ -17,6 +17,8 @@ dpkg (1.17.22) UNRELEASED; urgency=low
     Reported by Joshua Rogers <megamansec@gmail.com>.
   * Do not match partial field names in control files. Closes: #769119
     Regression introduced in dpkg 1.10.
+  * Fix build on Mac OS X. Regression introduced in dpkg 1.17.11.
+    Reported by Dominyk Tiller <dominyktiller@gmail.com>.
 
   [ Updated programs translations ]
   * German (Sven Joachim).

+ 4 - 4
lib/dpkg/fdio.c

@@ -109,13 +109,13 @@ fd_allocate_size(int fd, off_t offset, off_t len)
 	/* On Mac OS X. */
 	fstore_t fs;
 
-	fs_preallocate_setup(&fs, F_ALLOCATECONTIG, offset, len);
-	rc = fcntl(fd, F_PREALLOCATE, &fs)
+	fd_preallocate_setup(&fs, F_ALLOCATECONTIG, offset, len);
+	rc = fcntl(fd, F_PREALLOCATE, &fs);
 	if (rc < 0 && errno == ENOSPC) {
 		/* If we cannot get a contiguous allocation, then try
 		 * non-contiguous. */
-		fs_preallocate_setup(&fs, F_ALLOCATEALL, offset, len);
-		rc = fcntl(fd, F_PREALLOCATE, &fs)
+		fd_preallocate_setup(&fs, F_ALLOCATEALL, offset, len);
+		rc = fcntl(fd, F_PREALLOCATE, &fs);
 	}
 #elif defined(HAVE_F_ALLOCSP64)
 	/* On Solaris. */