public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/afpfs-ng] epel10: Port to C99
@ 2026-11-06 15:37 Florian Weimer
  0 siblings, 0 replies; only message in thread
From: Florian Weimer @ 2026-11-06 15:37 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/afpfs-ng
            Branch : epel10
            Commit : c7c078c518ca6afca30f3ebef65293a3fb86aaaf
            Author : Florian Weimer <fweimer@redhat.com>
            Date   : 2022-12-21T14:26:40+01:00
            Stats  : +169/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/afpfs-ng/c/c7c078c518ca6afca30f3ebef65293a3fb86aaaf?branch=epel10

            Log:
            Port to C99

Related to:

  <https://fedoraproject.org/wiki/Changes/PortingToModernC>
  <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>

---
diff --git a/afpfs-ng-c99.patch b/afpfs-ng-c99.patch
new file mode 100644
index 0000000..ea7c282
--- /dev/null
+++ b/afpfs-ng-c99.patch
@@ -0,0 +1,164 @@
+Add additional #include directives for more function prototypes,
+to avoid implicit function declarations.  Declare appledouble_write,
+cmdline_afp_setup_client in the appropriate header files.
+
+These changes expose an argument type mismatch in the function
+appledouble_truncate, in the calls to remove_opened_fork.  This may
+or may have not worked before, depending on how the ABI implements
+passing this struct by value. 
+
+The use of basename in start_afpfsd is suspect; this should probaby use
+dirname instead.
+
+Submitted upstream: <https://sourceforge.net/p/afpfs-ng/patches/5/>
+
+diff --git a/cmdline/cmdline_afp.h b/cmdline/cmdline_afp.h
+index ebdf357fc952972c..e0ec4570f69b71ec 100644
+--- a/cmdline/cmdline_afp.h
++++ b/cmdline/cmdline_afp.h
+@@ -28,5 +28,6 @@ int com_disconnect(char * arg);
+ void cmdline_afp_exit(void);
+ 
+ int cmdline_afp_setup(int recursive, char * url_string);
++void cmdline_afp_setup_client(void);
+ 
+ #endif
+diff --git a/cmdline/cmdline_main.c b/cmdline/cmdline_main.c
+index ffb39ebacb8f262c..deccf8a4cc342bf0 100644
+--- a/cmdline/cmdline_main.c
++++ b/cmdline/cmdline_main.c
+@@ -17,6 +17,7 @@
+ #include <getopt.h>
+ #include <ctype.h>
+ #include <signal.h>
++#include "afp.h"
+ #include "cmdline_afp.h"
+ #include "cmdline_testafp.h"
+ 
+diff --git a/fuse/client.c b/fuse/client.c
+index d19e9efb2dcb60b7..beceaa5594a89b80 100644
+--- a/fuse/client.c
++++ b/fuse/client.c
+@@ -10,6 +10,7 @@
+ #include <unistd.h>
+ #include <errno.h>
+ #include <grp.h>
++#include <libgen.h>
+ 
+ #include "config.h"
+ #include <afp.h>
+diff --git a/fuse/daemon.c b/fuse/daemon.c
+index 8b3b8d9146633518..abf6c02e390142b2 100644
+--- a/fuse/daemon.c
++++ b/fuse/daemon.c
+@@ -23,6 +23,8 @@
+ #include <signal.h>
+ #include <sys/socket.h>
+ 
++#include <fuse.h>
++
+ #include "afp.h"
+ 
+ #include "dsi.h"
+diff --git a/lib/dsi.c b/lib/dsi.c
+index 8a469794542ec447..3fd10fb24c770ca8 100644
+--- a/lib/dsi.c
++++ b/lib/dsi.c
+@@ -27,6 +27,7 @@
+ #include "libafpclient.h"
+ #include "afp_internal.h"
+ #include "afp_replies.h"
++#include "codepage.h"
+ 
+ /* define this in order to get reams of DSI debugging information */
+ #undef DEBUG_DSI
+diff --git a/lib/lowlevel.c b/lib/lowlevel.c
+index f3b632c2ae2da763..1edc9cdce5cc8429 100644
+--- a/lib/lowlevel.c
++++ b/lib/lowlevel.c
+@@ -25,6 +25,8 @@
+ #include "utils.h"
+ #include "did.h"
+ #include "users.h"
++#include "midlevel.h"
++#include "forklist.h"
+ 
+ static void set_nonunix_perms(unsigned int * mode, struct afp_file_info *fp) 
+ {
+diff --git a/lib/proto_files.c b/lib/proto_files.c
+index 933956da6a6d2ce6..d2acd562a2671869 100644
+--- a/lib/proto_files.c
++++ b/lib/proto_files.c
+@@ -14,6 +14,7 @@
+ #include "dsi_protocol.h"
+ #include "afp_protocol.h"
+ #include "afp_internal.h"
++#include "afp_replies.h"
+ 
+ /* afp_setfileparms, afp_setdirparms and afpsetfiledirparms are all remarkably
+    similiar.  We abstract them to afp-setparms_lowlevel. */
+diff --git a/lib/proto_replyblock.c b/lib/proto_replyblock.c
+index f66791614a52ca3d..c59629b24ab83cec 100644
+--- a/lib/proto_replyblock.c
++++ b/lib/proto_replyblock.c
+@@ -10,6 +10,7 @@
+ #include "afp.h"
+ #include "utils.h"
+ #include "afp_internal.h"
++#include "afp_replies.h"
+ 
+ 
+ /* FIXME: should do bounds checking */
+diff --git a/lib/resource.c b/lib/resource.c
+index 6be4a5b1de51fec5..fb39889f0d7702c0 100644
+--- a/lib/resource.c
++++ b/lib/resource.c
+@@ -8,6 +8,7 @@
+ #include "lowlevel.h"
+ #include "did.h"
+ #include "midlevel.h"
++#include "forklist.h"
+ 
+ #define appledouble ".AppleDouble"
+ #define finderinfo_string ".finderinfo"
+@@ -362,12 +363,12 @@ int appledouble_truncate(struct afp_volume * volume, const char * path, int offs
+ 			ret=ll_zero_file(volume,fp.forkid,0);
+ 			if (ret<0) {
+ 				afp_closefork(volume,fp.forkid);
+-				remove_opened_fork(volume,fp);
++				remove_opened_fork(volume,&fp);
+ 				free(newpath);
+ 				return ret;
+ 			}
+ 			afp_closefork(volume,fp.forkid);
+-			remove_opened_fork(volume,fp);
++			remove_opened_fork(volume,&fp);
+ 
+ 			return 1;
+ 		case AFP_META_APPLEDOUBLE:
+diff --git a/lib/resource.h b/lib/resource.h
+index 6a0d38a6275dd6f5..2efff106c94e6637 100644
+--- a/lib/resource.h
++++ b/lib/resource.h
+@@ -31,6 +31,9 @@ int appledouble_read(struct afp_volume * volume, struct afp_file_info *fp,
+ 
+ int appledouble_close(struct afp_volume * volume, struct afp_file_info * fp);
+ 
++int appledouble_write(struct afp_volume * volume, struct afp_file_info *fp,
++                const char *data, size_t size, off_t offset, size_t *totalwritten);
++
+ int appledouble_chmod(struct afp_volume * volume, const char * path, mode_t mode);
+ 
+ int appledouble_unlink(struct afp_volume * volume, const char *path);
+diff --git a/lib/server.c b/lib/server.c
+index 977c418efccae88b..93400dd92a4c0af6 100644
+--- a/lib/server.c
++++ b/lib/server.c
+@@ -7,6 +7,7 @@
+ 
+ #include <string.h>
+ #include <time.h>
++#include <sys/time.h>
+ 
+ #include "afp.h"
+ #include "dsi.h"

diff --git a/afpfs-ng.spec b/afpfs-ng.spec
index 6667004..24ff8b5 100644
--- a/afpfs-ng.spec
+++ b/afpfs-ng.spec
@@ -1,6 +1,6 @@
 Name:           afpfs-ng
 Version:        0.8.1
-Release:        40%{?dist}
+Release:        41%{?dist}
 Summary:        Apple Filing Protocol client
 
 
@@ -17,6 +17,7 @@ Patch1:         afpfs-ng-0.8.1-pointer.patch
 # Sent by e-mail to Alex deVries <alexthepuffin@gmail.com>
 Patch2:         afpfs-ng-0.8.1-formatsec.patch
 Patch3:         afpfs-ng-0.8.1-longoptions.patch
+Patch4: afpfs-ng-c99.patch
 
 %{?with_fuse:BuildRequires: fuse-devel}
 BuildRequires: gcc
@@ -108,6 +109,9 @@ cp -p include/* %{buildroot}%{_includedir}/afpfs-ng
 %{_libdir}/*.so
 
 %changelog
+* Wed Dec 21 2022 Florian Weimer <fweimer@redhat.com> - 0.8.1-41
+- Port to C99
+
 * Tue Oct 25 2022 Michal Ambroz <rebus _AT seznam.cz> - 0.8.1-40
 - remove the libafpclient.la libtool file
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-06 15:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-06 15:37 [rpms/afpfs-ng] epel10: Port to C99 Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox