Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Dec 2024 08:46:25 GMT
From:      Juraj Lutter <otis@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: d1169c6e586f - main - sysutils/lockfile-progs: Fix build on releng/13
Message-ID:  <202412120846.4BC8kPaG029036@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by otis:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d1169c6e586f88386af33928d552dc9160fded61

commit d1169c6e586f88386af33928d552dc9160fded61
Author:     Juraj Lutter <otis@FreeBSD.org>
AuthorDate: 2024-12-11 19:03:17 +0000
Commit:     Juraj Lutter <otis@FreeBSD.org>
CommitDate: 2024-12-12 08:44:52 +0000

    sysutils/lockfile-progs: Fix build on releng/13
    
    While building in on releng/13, the following error occurs:
    
    lockfile-progs.c:312:7: error: expected expression
      312 |       char *err = 0L;
          |       ^
    lockfile-progs.c:313:26: error: use of undeclared identifier 'err'
      313 |       int rc = asprintf(&err, "unrecognized error status (%d)", status);
          |                          ^
    lockfile-progs.c:319:14: error: use of undeclared identifier 'err'
      319 |       return err;
          |              ^
    
    This small patch addresses this problem.
    
    Approved by:    yasu (maintainer)
    Differential Revision: https://reviews.freebsd.org/D48037
---
 .../lockfile-progs/files/patch-lockfile-progs.c    | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/sysutils/lockfile-progs/files/patch-lockfile-progs.c b/sysutils/lockfile-progs/files/patch-lockfile-progs.c
new file mode 100644
index 000000000000..e5b625f23590
--- /dev/null
+++ b/sysutils/lockfile-progs/files/patch-lockfile-progs.c
@@ -0,0 +1,28 @@
+--- lockfile-progs.c.orig	2024-12-11 18:54:17 UTC
++++ lockfile-progs.c
+@@ -278,6 +278,8 @@ get_status_code_string(int status)
+ static char*
+ get_status_code_string(int status)
+ {
++  char *err = NULL;
++
+   switch (status)
+   {
+     case L_SUCCESS:
+@@ -309,15 +311,12 @@ get_status_code_string(int status)
+       break;
+ 
+     default:
+-      char *err = 0L;
+-      int rc = asprintf(&err, "unrecognized error status (%d)", status);
+-      if (rc < 0)
++      if (asprintf(&err, "unrecognized error status (%d)", status) < 0)
+       {
+         msg(stderr, "unable to generate error message");
+         exit(2);
+       }
+       return err;
+-      break;
+   }
+ }
+ 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202412120846.4BC8kPaG029036>