sync dpkg 1.21.13, Mon, 19 Dec 2022 02:07:45 +0100

This commit is contained in:
Steffen Nurpmeso 2022-12-19 22:19:21 +01:00
parent 6209edbd1d
commit c037bdfb89
2 changed files with 20 additions and 15 deletions

View File

@ -29,9 +29,9 @@ index d16f0ed..1c3ff78 100644
+# define HAVE_IOPRIO_SET
+# define HAVE_SETSID
+
+# define DPKG_ATTR_NORET __attribute__((noreturn))
+# define DPKG_ATTR_PRINTF(X)
+# define DPKG_ATTR_VPRINTF(X)
+# define LIBCOMPAT_ATTR_NORET __attribute__((noreturn))
+# define LIBCOMPAT_ATTR_PRINTF(X)
+# define LIBCOMPAT_ATTR_VPRINTF(X)
+
+# define _GNU_SOURCE
+# include <unistd.h>

View File

@ -135,6 +135,11 @@
#define SCHED_RR -1
#endif
/* At least macOS and AIX do not define this. */
#ifndef SOCK_NONBLOCK
#define SOCK_NONBLOCK 0
#endif
#if defined(OS_Linux)
/* This comes from TASK_COMM_LEN defined in Linux' include/linux/sched.h. */
#define PROCESS_NAME_SIZE 15
@ -287,7 +292,7 @@ static int schedule_length;
static struct schedule_item *schedule = NULL;
static void DPKG_ATTR_PRINTF(1)
static void LIBCOMPAT_ATTR_PRINTF(1)
debug(const char *format, ...)
{
va_list arglist;
@ -300,7 +305,7 @@ debug(const char *format, ...)
va_end(arglist);
}
static void DPKG_ATTR_PRINTF(1)
static void LIBCOMPAT_ATTR_PRINTF(1)
info(const char *format, ...)
{
va_list arglist;
@ -313,7 +318,7 @@ info(const char *format, ...)
va_end(arglist);
}
static void DPKG_ATTR_PRINTF(1)
static void LIBCOMPAT_ATTR_PRINTF(1)
warning(const char *format, ...)
{
va_list arglist;
@ -324,7 +329,7 @@ warning(const char *format, ...)
va_end(arglist);
}
static void DPKG_ATTR_NORET DPKG_ATTR_VPRINTF(2)
static void LIBCOMPAT_ATTR_NORET LIBCOMPAT_ATTR_VPRINTF(2)
fatalv(int errno_fatal, const char *format, va_list args)
{
va_list args_copy;
@ -344,7 +349,7 @@ fatalv(int errno_fatal, const char *format, va_list args)
exit(2);
}
static void DPKG_ATTR_NORET DPKG_ATTR_PRINTF(1)
static void LIBCOMPAT_ATTR_NORET LIBCOMPAT_ATTR_PRINTF(1)
fatal(const char *format, ...)
{
va_list args;
@ -353,7 +358,7 @@ fatal(const char *format, ...)
fatalv(0, format, args);
}
static void DPKG_ATTR_NORET DPKG_ATTR_PRINTF(1)
static void LIBCOMPAT_ATTR_NORET LIBCOMPAT_ATTR_PRINTF(1)
fatale(const char *format, ...)
{
va_list args;
@ -364,7 +369,7 @@ fatale(const char *format, ...)
#define BUG(...) bug(__FILE__, __LINE__, __func__, __VA_ARGS__)
static void DPKG_ATTR_NORET DPKG_ATTR_PRINTF(4)
static void LIBCOMPAT_ATTR_NORET LIBCOMPAT_ATTR_PRINTF(4)
bug(const char *file, int line, const char *func, const char *format, ...)
{
va_list arglist;
@ -561,8 +566,8 @@ setup_socket_name(const char *suffix)
{
const char *basedir;
if (getuid() == 0 && access("/run", F_OK) == 0) {
basedir = "/run";
if (getuid() == 0 && access(RUNSTATEDIR, F_OK) == 0) {
basedir = RUNSTATEDIR;
} else {
basedir = getenv("TMPDIR");
if (basedir == NULL)
@ -627,7 +632,7 @@ create_notify_socket(void)
su.sun_family = AF_UNIX;
strncpy(su.sun_path, sockname, sizeof(su.sun_path) - 1);
rc = bind(fd, &su, sizeof(su));
rc = bind(fd, (struct sockaddr *)&su, sizeof(su));
if (rc < 0)
fatale("cannot bind to notification socket");
@ -958,7 +963,7 @@ do_version(void)
printf("Written by Marek Michalkiewicz, public domain.\n");
}
static void DPKG_ATTR_NORET
static void LIBCOMPAT_ATTR_NORET
badusage(const char *msg)
{
if (msg)
@ -2701,7 +2706,7 @@ do_stop_summary(int retry_nr)
printf(".\n");
}
static void DPKG_ATTR_PRINTF(1)
static void LIBCOMPAT_ATTR_PRINTF(1)
set_what_stop(const char *format, ...)
{
va_list arglist;