diff options
-rw-r--r-- | Makefile | 5 | ||||
-rw-r--r-- | src/nshd/hackers_git/name2gid.go | 7 |
2 files changed, 8 insertions, 4 deletions
@@ -5,6 +5,9 @@ systemddir = $(libdir)/systemd GOPATH := $(realpath $(dir $(lastword $(MAKEFILE_LIST)))) +CFLAGS = -std=c99 -Wall -Wextra -Werror -pedantic +CGO_CFLAGS = $(CFLAGS) -Wno-unused-parameter + deps = gopkg.in/yaml.v2 subdirs = src/nslcd_proto @@ -38,7 +41,7 @@ $(foreach d,$(deps),$(eval src/$d: NET; GOPATH='$(GOPATH)' go get -d -u $d)) .PHONY: NET bin/nshd: $(download) $(generate) $(shell find src -name .git -prune -o -print) - GOPATH='$(GOPATH)' go install nshd + GOPATH='$(GOPATH)' CGO_CFLAGS='$(CGO_CFLAGS)' go install nshd $(DESTDIR)$(bindir)/%: bin/% install -Dm755 $< $@ diff --git a/src/nshd/hackers_git/name2gid.go b/src/nshd/hackers_git/name2gid.go index b33e6aa..c155d29 100644 --- a/src/nshd/hackers_git/name2gid.go +++ b/src/nshd/hackers_git/name2gid.go @@ -5,9 +5,10 @@ import ( "unsafe" ) -//#include <stdlib.h> /* free */ -//#include <unistd.h> /* sysconf */ -//#include <grp.h> /* getgrnam_r */ +//#define _XOPEN_SOURCE /* for getgrnam_r(3) in grp.h */ +//#include <stdlib.h> /* for free(3) */ +//#include <unistd.h> /* for sysconf(3) */ +//#include <grp.h> /* for getgrnam_r(3) */ import "C" func name2gid(name string) (gid int32) { |