Skip to content
This repository has been archived by the owner on Nov 7, 2022. It is now read-only.

Build fails on FreeBSD because peercred is undeclared #233

Closed
pvalkone opened this issue Aug 27, 2018 · 2 comments
Closed

Build fails on FreeBSD because peercred is undeclared #233

pvalkone opened this issue Aug 27, 2018 · 2 comments

Comments

@pvalkone
Copy link

I maintain an unofficial FreeBSD port of i3 (gaps-next branch) at https://github.com/pvalkone/freebsd-ports/tree/master/x11-wm/i3-gaps-next. After commit 37d0105, the build begun failing because the peercred struct is only defined on Linux, but used later outside the #if block regardless of the OS.

In file included from ../../i3-65c551b/include/all.h:47:0,
                 from ../../i3-65c551b/src/ipc.c:10:
../../i3-65c551b/src/ipc.c: In function 'ipc_client_timeout':
../../i3-65c551b/src/ipc.c:1438:94: error: 'peercred' undeclared (first use in this function); did you mean 'sockcred'?
         ELOG("client %p with pid %d and cmdline '%s' on fd %d timed out, killing\n", client, peercred.pid, cmdline, client->fd);
                                                                                              ^
../../i3-65c551b/include/log.h:31:50: note: in definition of macro 'ELOG'
 #define ELOG(fmt, ...) errorlog("ERROR: " fmt, ##__VA_ARGS__)
                                                  ^~~~~~~~~~~
../../i3-65c551b/src/ipc.c:1438:94: note: each undeclared identifier is reported only once for each function it appears in
         ELOG("client %p with pid %d and cmdline '%s' on fd %d timed out, killing\n", client, peercred.pid, cmdline, client->fd);
                                                                                              ^
../../i3-65c551b/include/log.h:31:50: note: in definition of macro 'ELOG'
 #define ELOG(fmt, ...) errorlog("ERROR: " fmt, ##__VA_ARGS__)
                                                  ^~~~~~~~~~~
../../i3-65c551b/src/ipc.c:1436:1: warning: label 'end' defined but not used [-Wunused-label]
 end:
 ^~~
gmake[3]: *** [Makefile:2358: src/i3-ipc.o] Error 1
gmake[3]: Leaving directory '/usr/home/pvalkone/src/freebsd-ports/x11-wm/i3-gaps-next/work/i3-65c551b/build'
gmake[2]: *** [Makefile:1321: all] Error 2
gmake[2]: Leaving directory '/usr/home/pvalkone/src/freebsd-ports/x11-wm/i3-gaps-next/work/i3-65c551b/build'
*** Error code 2

Stop.
make[1]: stopped in /usr/home/pvalkone/src/freebsd-ports/x11-wm/i3-gaps-next
*** Error code 1

Stop.
make: stopped in /usr/home/pvalkone/src/freebsd-ports/x11-wm/i3-gaps-next```
orestisfl added a commit to orestisfl/i3 that referenced this issue Aug 27, 2018
Also moved the 'end' label because it is unused otherwise.

Reported here: Airblader/i3#233
@orestisfl
Copy link
Collaborator

Thanks for reporting this.

This is an issue with i3, not i3-gaps. I submitted a PR: i3/i3#3375

@Airblader
Copy link
Owner

Annd merged. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants