mirror of
https://git.freebsd.org/ports.git
synced 2025-04-28 01:26:39 -04:00
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
This commit is contained in:
parent
12c9b8ee36
commit
d1169c6e58
1 changed files with 28 additions and 0 deletions
28
sysutils/lockfile-progs/files/patch-lockfile-progs.c
Normal file
28
sysutils/lockfile-progs/files/patch-lockfile-progs.c
Normal file
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue