public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Filipe Rosset <rosset.filipe@gmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/bonnie++] epel10: Fix build warnings
Date: Sat, 30 May 2026 18:14:18 GMT [thread overview]
Message-ID: <178016485835.1.10958219541780351050.rpms-bonnie++-f651c7215fa2@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/bonnie++
Branch : epel10
Commit : f651c7215fa2a763272519d1d0371cd61b6969f0
Author : Filipe Rosset <rosset.filipe@gmail.com>
Date : 2026-03-14T12:24:02-03:00
Stats : +182/-1 in 4 file(s)
URL : https://src.fedoraproject.org/rpms/bonnie++/c/f651c7215fa2a763272519d1d0371cd61b6969f0?branch=epel10
Log:
Fix build warnings
---
diff --git a/bonnie++-2.00a-security.patch b/bonnie++-2.00a-security.patch
new file mode 100644
index 0000000..c7e905c
--- /dev/null
+++ b/bonnie++-2.00a-security.patch
@@ -0,0 +1,39 @@
+--- a/bon_suid.cpp 2009-07-02 23:25:14.000000000 -0300
++++ b/bon_suid.cpp 2026-03-14 12:22:03.934967696 -0300
+@@ -67,12 +67,36 @@
+ }
+ if(setGroup)
+ {
++ if(userName)
++ {
++ if(initgroups(userName, groupId))
++ {
++ fprintf(stderr, "Can't init groups for %s.\n", userName);
++ return 1;
++ }
++ }
++ else
++ {
++ if(setgroups(0, NULL))
++ {
++ fprintf(stderr, "Can't set groups.\n");
++ return 1;
++ }
++ }
+ if(setgid(groupId))
+ {
+ fprintf(stderr, "Can't set gid to %d.\n", int(groupId));
+ return 1;
+ }
+ }
++ else
++ {
++ if(setgroups(0, NULL))
++ {
++ fprintf(stderr, "Can't set groups.\n");
++ return 1;
++ }
++ }
+ if(setuid(userId))
+ {
+ fprintf(stderr, "Can't set uid to %d.\n", int(userId));
diff --git a/bonnie++-2.00a-warnings.patch b/bonnie++-2.00a-warnings.patch
new file mode 100644
index 0000000..3f02d8b
--- /dev/null
+++ b/bonnie++-2.00a-warnings.patch
@@ -0,0 +1,83 @@
+--- a/bon_file.cpp 2016-12-13 00:37:51.000000000 -0200
++++ b/bon_file.cpp 2026-03-14 12:17:19.311405446 -0300
+@@ -61,7 +61,7 @@
+ }
+ if(m_number_directories > 1)
+ {
+- char buf[6];
++ char buf[11];
+ for(i = 0; i < m_number_directories; i++)
+ {
+ sprintf(buf, "%05d", i);
+@@ -370,7 +370,7 @@
+ }
+ if(m_number_directories > 1)
+ {
+- char buf[6];
++ char buf[11];
+ for(i = 0; i < m_number_directories; i++)
+ {
+ sprintf(buf, "%05d", i);
+@@ -412,7 +412,7 @@
+ Duration dur;
+ for(int i = 0; i < m_number_directories; i++)
+ {
+- char buf[6];
++ char buf[11];
+ if(m_number_directories != 1)
+ {
+ sprintf(buf, "%05d", i);
+@@ -555,7 +555,7 @@
+ Duration dur;
+ for(int i = 0; i < m_number_directories; i++)
+ {
+- char buf[6];
++ char buf[11];
+ if(m_number_directories != 1)
+ {
+ sprintf(buf, "%05d", i);
+--- a/bon_io.cpp 2018-09-13 10:07:36.000000000 -0300
++++ b/bon_io.cpp 2026-03-14 12:17:19.309455633 -0300
+@@ -159,7 +159,7 @@
+
+ if(rc == OFF_TYPE(-1))
+ {
+- sprintf(m_buf, "Error in lseek to chunk %d(" OFF_T_PRINTF ")", offset, real_offset);
++ sprintf(m_buf, "Error in lseek to chunk %d(" OFF_T_PRINTF ")", offset, (long long)real_offset);
+ perror(m_buf);
+ return rc;
+ }
+--- a/bon_time.cpp 2018-09-13 11:54:36.000000000 -0300
++++ b/bon_time.cpp 2026-03-14 12:17:19.312905858 -0300
+@@ -146,7 +146,7 @@
+ }
+ else
+ {
+- fprintf(m_fp, " %5d", stat);
++ fprintf(m_fp, " %5d", (int)stat);
+ }
+ }
+ else
+--- a/getc_putc.cpp 2018-09-15 04:00:31.000000000 -0300
++++ b/getc_putc.cpp 2026-03-14 12:17:19.308873750 -0300
+@@ -184,7 +184,7 @@
+ fprintf(stderr, "Can't get results from child.\n");
+ return 1;
+ }
+- fclose(child);
++ pclose(child);
+
+ FILE *fp = fdopen(FILE_FD, "w+");
+ if(!fp)
+--- a/sync.cpp 2008-12-23 23:19:01.000000000 -0200
++++ b/sync.cpp 2026-03-14 12:17:48.227922071 -0300
+@@ -19,7 +19,8 @@
+ printf("\n%d:\n", nr_sem);
+ fflush(NULL);
+ char buf[16];
+- fgets(buf, sizeof(buf) - 1, stdin);
++ if (fgets(buf, sizeof(buf) - 1, stdin) == NULL) { /* ignore */ }
++ break;
+ case eNone:
+ break;
+ }
diff --git a/bonnie++-makefile-modernize.patch b/bonnie++-makefile-modernize.patch
new file mode 100644
index 0000000..562478a
--- /dev/null
+++ b/bonnie++-makefile-modernize.patch
@@ -0,0 +1,57 @@
+--- a/Makefile.in 2008-12-30 19:04:25.000000000 -0200
++++ b/Makefile.in 2026-03-14 12:21:50.864972374 -0300
+@@ -16,6 +16,7 @@
+
+ INSTALL=@INSTALL@
+ INSTALL_PROGRAM=@INSTALL_PROGRAM@
++DESTDIR=
+
+ BONSRC=bonnie++.cpp bon_io.cpp bon_file.cpp bon_time.cpp semaphore.cpp \
+ sync.cpp thread.cpp bon_suid.cpp duration.cpp rand.o util.o
+@@ -34,33 +35,33 @@
+ GETCHOBJS=$(GETCHSRC:.cpp=.o)
+
+ bonnie++: $(BONOBJS)
+- $(LINK) -o bonnie++ $(BONOBJS) $(THREAD_LFLAGS)
++ $(LINK) $(LDFLAGS) -o bonnie++ $(BONOBJS) $(THREAD_LFLAGS)
+
+ zcav: $(ZCAVOBJS)
+- $(LINK) -o zcav $(ZCAVOBJS) $(THREAD_LFLAGS)
++ $(LINK) $(LDFLAGS) -o zcav $(ZCAVOBJS) $(THREAD_LFLAGS)
+
+ getc_putc: $(GETCOBJS) getc_putc_helper
+- $(LINK) -o getc_putc $(GETCOBJS) $(THREAD_LFLAGS)
++ $(LINK) $(LDFLAGS) -o getc_putc $(GETCOBJS) $(THREAD_LFLAGS)
+
+ getc_putc_helper: $(GETCHOBJS)
+- $(CXX) -o getc_putc_helper $(GETCHOBJS)
++ $(CXX) $(LDFLAGS) -o getc_putc_helper $(GETCHOBJS)
+
+ bon_csv2html: bon_csv2html.o
+- $(LINK) bon_csv2html.o -o bon_csv2html
++ $(LINK) $(LDFLAGS) bon_csv2html.o -o bon_csv2html
+
+ generate_randfile: generate_randfile.o
+- $(LINK) generate_randfile.o -o generate_randfile
++ $(LINK) $(LDFLAGS) generate_randfile.o -o generate_randfile
+
+ install-bin: $(EXE) $(EXES)
+- mkdir -p $(eprefix)/bin $(eprefix)/sbin
+- @INSTALL_PROGRAM@ @stripping@ $(EXES) $(eprefix)/sbin
+- @INSTALL_PROGRAM@ @stripping@ $(EXE) $(eprefix)/bin
+- @INSTALL_SCRIPT@ $(SCRIPTS) $(eprefix)/bin
++ mkdir -p $(DESTDIR)$(eprefix)/bin $(DESTDIR)$(eprefix)/sbin
++ @INSTALL_PROGRAM@ @stripping@ $(EXES) $(DESTDIR)$(eprefix)/bin
++ @INSTALL_PROGRAM@ @stripping@ $(EXE) $(DESTDIR)$(eprefix)/bin
++ @INSTALL_SCRIPT@ $(SCRIPTS) $(DESTDIR)$(eprefix)/bin
+
+ install: install-bin
+- mkdir -p @mandir@/man1 @mandir@/man8
+- @INSTALL_DATA@ $(MAN1) @mandir@/man1
+- @INSTALL_DATA@ $(MAN8) @mandir@/man8
++ mkdir -p $(DESTDIR)@mandir@/man1 $(DESTDIR)@mandir@/man8
++ @INSTALL_DATA@ $(MAN1) $(DESTDIR)@mandir@/man1
++ @INSTALL_DATA@ $(MAN8) $(DESTDIR)@mandir@/man8
+
+ %.o: %.cpp
+ $(CXX) -c $<
diff --git a/bonnie++.spec b/bonnie++.spec
index 62682cd..b565d6c 100644
--- a/bonnie++.spec
+++ b/bonnie++.spec
@@ -7,6 +7,8 @@ License: GPL-2.0-only
URL: http://www.coker.com.au/bonnie++/
Source0: http://www.coker.com.au/bonnie++/experimental/bonnie++-%{version}.tgz
Patch0: %{name}-makefile.patch
+# Fix build warnings (mismatched-dealloc, format-overflow, etc.)
+Patch1: %{name}-2.00a-warnings.patch
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: make
@@ -22,7 +24,7 @@ Do not leave bonnie++ installed on a production system. Use only while you
test servers.
%prep
-%autosetup
+%autosetup -p1
%build
%configure --disable-stripping
reply other threads:[~2026-05-30 18:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178016485835.1.10958219541780351050.rpms-bonnie++-f651c7215fa2@fedoraproject.org \
--to=rosset.filipe@gmail.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox