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

libdpkg: Add new cu_filename() function

Guillem Jover лет назад: 14
Родитель
Сommit
7e892ff30f
3 измененных файлов с 10 добавлено и 0 удалено
  1. 8 0
      lib/dpkg/cleanup.c
  2. 1 0
      lib/dpkg/dpkg.h
  3. 1 0
      lib/dpkg/libdpkg.map

+ 8 - 0
lib/dpkg/cleanup.c

@@ -59,3 +59,11 @@ cu_closefd(int argc, void **argv)
 
 	close(ip);
 }
+
+void
+cu_filename(int argc, void **argv)
+{
+	const char *filename = argv[0];
+
+	unlink(filename);
+}

+ 1 - 0
lib/dpkg/dpkg.h

@@ -146,6 +146,7 @@ void cu_closestream(int argc, void **argv);
 void cu_closepipe(int argc, void **argv);
 void cu_closedir(int argc, void **argv);
 void cu_closefd(int argc, void **argv);
+void cu_filename(int argc, void **argv);
 
 /*** from mlib.c ***/
 

+ 1 - 0
lib/dpkg/libdpkg.map

@@ -46,6 +46,7 @@ LIBDPKG_PRIVATE {
 	cu_closestream;
 	cu_closedir;
 	cu_closefd;
+	cu_filename;
 
 	# ‘Must do’ functions
 	m_malloc;