diff --git a/Makefile b/Makefile index 9b391fd..16c8f20 100644 --- a/Makefile +++ b/Makefile @@ -14,12 +14,19 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +debug = 0 + PREFIX = /usr/local BINDIR = $(PREFIX)/bin INSTALL = install -c CFLAGS += -Wall +ifeq ($(debug), 1) + CFLAGS += -O0 -g +else + CFLAGS += -O2 -DNDEBUG +endif SRC := $(wildcard *.c) diff --git a/graftcp-local/main.go b/graftcp-local/main.go index 7c6f9ec..217914b 100644 --- a/graftcp-local/main.go +++ b/graftcp-local/main.go @@ -33,10 +33,7 @@ func (app *App) run() { l := NewLocal(app.ListenAddr, app.Socks5Addr) syscall.Mkfifo(app.PipePath, uint32(os.ModePerm)) - err = os.Chmod(app.PipePath, 0666) - if err != nil { - dlog.Fatalf("os.Chmod(%s, 0666) err: %s", app.PipePath, err.Error()) - } + os.Chmod(app.PipePath, 0666) l.FifoFd, err = os.OpenFile(app.PipePath, os.O_RDWR, 0) if err != nil { dlog.Fatalf("os.OpenFile(%s) err: %s", app.PipePath, err.Error())