summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: aa894d8)
raw | patch | inline | side by side (parent: aa894d8)
author | Junio C Hamano <junkio@cox.net> | |
Mon, 12 Sep 2005 05:25:49 +0000 (22:25 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 17 Sep 2005 18:57:50 +0000 (11:57 -0700) |
Jason Riedy suggests that we should be able to use getdomainname
if we properly specify which libraries to link.
Signed-off-by: Junio C Hamano <junkio@cox.net>
if we properly specify which libraries to link.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Makefile | patch | blob | history | |
convert-objects.c | patch | blob | history | |
ident.c | patch | blob | history |
diff --git a/Makefile b/Makefile
index b48fe44b384680fa2400c4963cb50371a3310ef1..0e9f2ec4aaf0dfb9b1d214e9e74277ea8c0458cc 100644 (file)
--- a/Makefile
+++ b/Makefile
endif
ifeq ($(shell uname -s),SunOS)
NEEDS_SOCKET = YesPlease
- PLATFORM_DEFINES += -DNO_GETDOMAINNAME=1
+ NEEDS_NSL = YesPlease
+ PLATFORM_DEFINES += -D__EXTENSIONS__
endif
ifndef SHELL_PATH
LIBS += -lsocket
SIMPLE_LIB += -lsocket
endif
+ifdef NEEDS_NSL
+ LIBS += -lnsl
+ SIMPLE_LIB += -lnsl
+endif
DEFINES += '-DSHA1_HEADER=$(SHA1_HEADER)'
diff --git a/convert-objects.c b/convert-objects.c
index 073cab592fba81c97e6f13d660b0329a42427ef0..9ad0c77678a740c82c91b4f99de039e12605808d 100644 (file)
--- a/convert-objects.c
+++ b/convert-objects.c
#define _XOPEN_SOURCE /* glibc2 needs this */
-#define __EXTENSIONS__ /* solaris needs this */
#include <time.h>
#include <ctype.h>
#include "cache.h"
index 0df2d979242bd6ee246bd280ffebdf8299408a8c..a2d241fba025f82fa4c77aeb345103db66168fa9 100644 (file)
--- a/ident.c
+++ b/ident.c
memcpy(real_email, pw->pw_name, len);
real_email[len++] = '@';
gethostname(real_email + len, sizeof(real_email) - len);
-#ifndef NO_GETDOMAINNAME
if (!strchr(real_email+len, '.')) {
len = strlen(real_email);
real_email[len++] = '.';
getdomainname(real_email+len, sizeof(real_email)-len);
}
-#endif
/* And set the default date */
datestamp(real_date, sizeof(real_date));
return 0;