From 140d538ca1b0cd7e79af699f96cead7662577fc6 Mon Sep 17 00:00:00 2001 From: bill-auger Date: Mon, 13 Apr 2020 00:08:35 -0400 Subject: [beanstalkd]: add package --- pcr-testing/beanstalkd/fix-warnings.patch | 51 +++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 pcr-testing/beanstalkd/fix-warnings.patch (limited to 'pcr-testing/beanstalkd/fix-warnings.patch') diff --git a/pcr-testing/beanstalkd/fix-warnings.patch b/pcr-testing/beanstalkd/fix-warnings.patch new file mode 100644 index 000000000..865c3781f --- /dev/null +++ b/pcr-testing/beanstalkd/fix-warnings.patch @@ -0,0 +1,51 @@ +diff --git a/ct/ct.c b/ct/ct.c +index e7b4e15..b797057 100644 +--- a/ct/ct.c ++++ b/ct/ct.c +@@ -323,8 +323,8 @@ runbenchn(Benchmark *b, int n) + ctstarttimer(); + b->f(n); + ctstoptimer(); +- write(durfd, &bdur, sizeof bdur); +- write(durfd, &bbytes, sizeof bbytes); ++ if (write(durfd, &bdur, sizeof bdur)); ++ if (write(durfd, &bbytes, sizeof bbytes)); + exit(0); + } + setpgid(pid, pid); +@@ -540,7 +540,7 @@ writetokens(int n) + if (wjobfd >= 0) { + fcntl(wjobfd, F_SETFL, fcntl(wjobfd, F_GETFL)|O_NONBLOCK); + for (; n>1; n--) { +- write(wjobfd, &c, 1); /* ignore error; nothing we can do anyway */ ++ if (write(wjobfd, &c, 1)); /* ignore error; nothing we can do anyway */ + } + } + } +diff --git a/file.c b/file.c +index e55a9c0..4211ea1 100644 +--- a/file.c ++++ b/file.c +@@ -533,7 +533,7 @@ filewclose(File *f) + if (!f) return; + if (!f->iswopen) return; + if (f->free) { +- (void)ftruncate(f->fd, f->w->filesize - f->free); ++ if (ftruncate(f->fd, f->w->filesize - f->free)); + } + close(f->fd); + f->iswopen = 0; +diff --git a/sd-daemon.c b/sd-daemon.c +index 8596961..3b46942 100644 +--- a/sd-daemon.c ++++ b/sd-daemon.c +@@ -355,7 +355,8 @@ int sd_notify(int unset_environment, const char *state) { + + memset(&sockaddr, 0, sizeof(sockaddr)); + sockaddr.sa.sa_family = AF_UNIX; +- strncpy(sockaddr.un.sun_path, e, sizeof(sockaddr.un.sun_path)); ++ strncpy(sockaddr.un.sun_path, e, sizeof(sockaddr.un.sun_path) - 1); ++ sockaddr.un.sun_path[sizeof(sockaddr.un.sun_path) - 1] = '\0'; + + if (sockaddr.un.sun_path[0] == '@') + sockaddr.un.sun_path[0] = 0; -- cgit v1.2.3