Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix building on FreeBSD. #2

Merged
merged 1 commit into from Jan 22, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Make.defines.freebsd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDDIR) $(LDFLAGS)
LDDIR = -L../lib
LDLIBS = ../lib/libapue.a $(EXTRALIBS)
CFLAGS += -DBSD -ansi -Wall $(EXTRA)
CFLAGS += -DHAVE_ACCTV1 -DBSD -ansi -Wall $(EXTRA)

# Our library that almost every program needs.
LIB = ../libapue.a
Expand Down
6 changes: 6 additions & 0 deletions local/freebsd.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
include ../Make.defines.freebsd

PROGS := $(patsubst %.c,%,$(wildcard *.c))

all: $(PROGS)
clean:; rm -f $(PROGS)
9 changes: 8 additions & 1 deletion proc/pracct.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
#define AXSIG 0
#endif

#ifdef HAVE_ACCTV1
typedef struct acctv1 acct_t;
#else
typedef struct acct acct_t;
#endif


static unsigned long
compt2ulong(comp_t comptime) /* convert comp_t to unsigned long */
{
Expand All @@ -28,7 +35,7 @@ compt2ulong(comp_t comptime) /* convert comp_t to unsigned long */
int
main(int argc, char *argv[])
{
struct acct acdata;
acct_t acdata;
FILE *fp;

if (argc != 2)
Expand Down