diff options
author | dougm <none@none> | 2007-01-11 16:21:40 -0800 |
---|---|---|
committer | dougm <none@none> | 2007-01-11 16:21:40 -0800 |
commit | 24424a35444c8487648be681d47bee4f57af0ffc (patch) | |
tree | 61c56e0ba74f57f65bbf464fea8d13f5a48c7395 | |
parent | 7752631cb397da3298ed0b30d6bfee48679c340f (diff) | |
download | illumos-joyent-24424a35444c8487648be681d47bee4f57af0ffc.tar.gz |
6499494 libshare's Makefiles need cleanup
6500069 libshare incorrectly uses gettext()
-rw-r--r-- | usr/src/lib/libshare/Makefile | 8 | ||||
-rw-r--r-- | usr/src/lib/libshare/Makefile.com | 36 | ||||
-rw-r--r-- | usr/src/lib/libshare/common/libshare.c | 50 | ||||
-rw-r--r-- | usr/src/lib/libshare/common/libshare_zfs.c | 5 | ||||
-rw-r--r-- | usr/src/lib/libshare/common/libsharecore.c | 29 | ||||
-rw-r--r-- | usr/src/lib/libshare/common/plugin.c | 5 |
6 files changed, 61 insertions, 72 deletions
diff --git a/usr/src/lib/libshare/Makefile b/usr/src/lib/libshare/Makefile index afdcaee749..1180729b1b 100644 --- a/usr/src/lib/libshare/Makefile +++ b/usr/src/lib/libshare/Makefile @@ -21,22 +21,18 @@ # # ident "%Z%%M% %I% %E% SMI" # -# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -include ../../Makefile.master - include ../Makefile.lib HDRS = libshare.h HDRDIR = common SUBDIRS = $(MACH) -ROOTHDRDIR= $(ROOT)/usr/include -ROOTHDRS= $(HDRS:%=$(ROOTHDRDIR)/%) MSGFILES= common/libshare.c common/libsharecore.c common/scfutil.c \ - common/parser.c common/libshare_zfs.c + common/plugin.c common/parser.c common/libshare_zfs.c POFILE= libshare.po all := TARGET = all diff --git a/usr/src/lib/libshare/Makefile.com b/usr/src/lib/libshare/Makefile.com index bb31b2fd43..bf1406b445 100644 --- a/usr/src/lib/libshare/Makefile.com +++ b/usr/src/lib/libshare/Makefile.com @@ -21,61 +21,43 @@ # # ident "%Z%%M% %I% %E% SMI" # -# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # LIBRARY = libshare.a VERS = .1 NFSLIB_DIR = $(SRC)/cmd/fs.d/nfs/lib -NFSSECSRC = $(NFSLIB_DIR)/nfs_sec.c -NFSSHARETAB = $(NFSLIB_DIR)/sharetab.c LIBOBJS = libshare.o libsharecore.o scfutil.o libshare_zfs.o \ plugin.o parser.o issubdir.o OTHOBJS = sharetab.o nfs_sec.o OBJECTS = $(LIBOBJS) $(OTHOBJS) -COMMON = ../common - -SRCS = $(OBJECTS:%.o=../%.c) -LIBSRCS = $(LIBOBJS:%.o=$(COMMON)/%.c) -POFILES = $(OBJECTS:%.o=%.po) -POFILE = libshare.po include ../../Makefile.lib +SRCDIR = ../common -ROOTDIRS= $(ROOT)/usr/include - -ROOTHDRS= $(HDRS:%=$(ROOTDIRS)/%) - -CHECKHDRS= $(HDRS:%.h=%.check) +LIBSRCS = $(LIBOBJS:%.o=$(SRCDIR)/%.c) +# we don't want to lint the sharetab and nfs_sec files +lintcheck := SRCS = $(LIBSRCS) LIBS = $(DYNLIB) $(LINTLIB) LDLIBS += -lc -lnsl -lscf -lzfs -luuid all install := LDLIBS += -lxml2 $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) -SRCDIR = ../common -MAPDIR = ../spec/$(TRANSMACH) -SPECMAPFILE = $(MAPDIR)/mapfile - #add nfs/lib directory as part of the include path -CFLAGS += $(CCVERBOSE) -g -CPPFLAGS += -D_REENTRANT -I$(SRC)/cmd/fs.d/nfs/lib -I/usr/include/libxml2 \ - -I../common +CFLAGS += $(CCVERBOSE) +CPPFLAGS += -D_REENTRANT -I$(NFSLIB_DIR) -I/usr/include/libxml2 \ + -I$(SRCDIR) .KEEP_STATE: all: $(LIBS) -# we don't want to lint the sharetab and nfs_sec files -lint: $$(LIBSRCS) - $(LINT.c) $(LINTCHECKFLAGS) $(LIBSRCS) $(LDLIBS) +lint: lintcheck pics/%.o: $(NFSLIB_DIR)/%.c $(COMPILE.c) -o $@ $< $(POST_PROCESS_O) include ../../Makefile.targ - -$(POFILE): $(POFILES) - $(RM) $@; cat $(POFILES) > $@ diff --git a/usr/src/lib/libshare/common/libshare.c b/usr/src/lib/libshare/common/libshare.c index 9b2f7fb8ed..9b54b30e1b 100644 --- a/usr/src/lib/libshare/common/libshare.c +++ b/usr/src/lib/libshare/common/libshare.c @@ -87,80 +87,80 @@ sa_errorstr(int err) switch (err) { case SA_OK: - ret = gettext("ok"); + ret = dgettext(TEXT_DOMAIN, "ok"); break; case SA_NO_SUCH_PATH: - ret = gettext("path doesn't exist"); + ret = dgettext(TEXT_DOMAIN, "path doesn't exist"); break; case SA_NO_MEMORY: - ret = gettext("no memory"); + ret = dgettext(TEXT_DOMAIN, "no memory"); break; case SA_DUPLICATE_NAME: - ret = gettext("name in use"); + ret = dgettext(TEXT_DOMAIN, "name in use"); break; case SA_BAD_PATH: - ret = gettext("bad path"); + ret = dgettext(TEXT_DOMAIN, "bad path"); break; case SA_NO_SUCH_GROUP: - ret = gettext("no such group"); + ret = dgettext(TEXT_DOMAIN, "no such group"); break; case SA_CONFIG_ERR: - ret = gettext("configuration error"); + ret = dgettext(TEXT_DOMAIN, "configuration error"); break; case SA_SYSTEM_ERR: - ret = gettext("system error"); + ret = dgettext(TEXT_DOMAIN, "system error"); break; case SA_SYNTAX_ERR: - ret = gettext("syntax error"); + ret = dgettext(TEXT_DOMAIN, "syntax error"); break; case SA_NO_PERMISSION: - ret = gettext("no permission"); + ret = dgettext(TEXT_DOMAIN, "no permission"); break; case SA_BUSY: - ret = gettext("busy"); + ret = dgettext(TEXT_DOMAIN, "busy"); break; case SA_NO_SUCH_PROP: - ret = gettext("no such property"); + ret = dgettext(TEXT_DOMAIN, "no such property"); break; case SA_INVALID_NAME: - ret = gettext("invalid name"); + ret = dgettext(TEXT_DOMAIN, "invalid name"); break; case SA_INVALID_PROTOCOL: - ret = gettext("invalid protocol"); + ret = dgettext(TEXT_DOMAIN, "invalid protocol"); break; case SA_NOT_ALLOWED: - ret = gettext("operation not allowed"); + ret = dgettext(TEXT_DOMAIN, "operation not allowed"); break; case SA_BAD_VALUE: - ret = gettext("bad property value"); + ret = dgettext(TEXT_DOMAIN, "bad property value"); break; case SA_INVALID_SECURITY: - ret = gettext("invalid security type"); + ret = dgettext(TEXT_DOMAIN, "invalid security type"); break; case SA_NO_SUCH_SECURITY: - ret = gettext("security type not found"); + ret = dgettext(TEXT_DOMAIN, "security type not found"); break; case SA_VALUE_CONFLICT: - ret = gettext("property value conflict"); + ret = dgettext(TEXT_DOMAIN, "property value conflict"); break; case SA_NOT_IMPLEMENTED: - ret = gettext("not implemented"); + ret = dgettext(TEXT_DOMAIN, "not implemented"); break; case SA_INVALID_PATH: - ret = gettext("invalid path"); + ret = dgettext(TEXT_DOMAIN, "invalid path"); break; case SA_NOT_SUPPORTED: - ret = gettext("operation not supported"); + ret = dgettext(TEXT_DOMAIN, "operation not supported"); break; case SA_PROP_SHARE_ONLY: - ret = gettext("property not valid for group"); + ret = dgettext(TEXT_DOMAIN, "property not valid for group"); break; case SA_NOT_SHARED: - ret = gettext("not shared"); + ret = dgettext(TEXT_DOMAIN, "not shared"); break; default: (void) snprintf(errstr, sizeof (errstr), - gettext("unknown %d"), err); + dgettext(TEXT_DOMAIN, "unknown %d"), err); ret = errstr; } return (ret); diff --git a/usr/src/lib/libshare/common/libshare_zfs.c b/usr/src/lib/libshare/common/libshare_zfs.c index bf7d3bf074..2466a277fe 100644 --- a/usr/src/lib/libshare/common/libshare_zfs.c +++ b/usr/src/lib/libshare/common/libshare_zfs.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -556,7 +556,8 @@ sa_get_zfs_shares(char *groupname) if (err == 0) { /* only print error once */ (void) fprintf(stderr, - gettext("Cannot create ZFS subgroup " + dgettext(TEXT_DOMAIN, + "Cannot create ZFS subgroup " "during initialization:" " %s\n"), sa_errorstr(SA_SYSTEM_ERR)); diff --git a/usr/src/lib/libshare/common/libsharecore.c b/usr/src/lib/libshare/common/libsharecore.c index 4ea50f5303..a2ed24afca 100644 --- a/usr/src/lib/libshare/common/libsharecore.c +++ b/usr/src/lib/libshare/common/libsharecore.c @@ -962,11 +962,12 @@ parse_dfstab(char *dfstab, xmlNodePtr root) else sgroup = NULL; } else { - (void) printf(gettext("No share specified in dfstab: " + (void) printf(dgettext(TEXT_DOMAIN, + "No share specified in dfstab: " "line %d: %s\n"), list->lineno, list->origline); add_syntax_comment(root, list->origline, - gettext("No share specified"), + dgettext(TEXT_DOMAIN, "No share specified"), 1); continue; } @@ -977,11 +978,13 @@ parse_dfstab(char *dfstab, xmlNodePtr root) group = defgroup; } if (defined_group && group == NULL) { - (void) printf(gettext("Unknown group used in dfstab: " + (void) printf(dgettext(TEXT_DOMAIN, + "Unknown group used in dfstab: " "line %d: %s\n"), list->lineno, list->origline); add_syntax_comment(root, list->origline, - gettext("Unknown group specified"), 1); + dgettext(TEXT_DOMAIN, + "Unknown group specified"), 1); continue; } if (group != NULL) { @@ -1006,26 +1009,31 @@ parse_dfstab(char *dfstab, xmlNodePtr root) (void) sa_set_share_attr(share, "resource", list->resource); } else { - (void) printf(gettext("Error in dfstab: " + (void) printf(dgettext(TEXT_DOMAIN, + "Error in dfstab: " "line %d: %s\n"), list->lineno, list->origline); if (err != SA_BAD_PATH) add_syntax_comment(root, list->origline, - gettext("Syntax"), 1); + dgettext(TEXT_DOMAIN, + "Syntax"), 1); else add_syntax_comment(root, list->origline, - gettext("Path"), 1); + dgettext(TEXT_DOMAIN, + "Path"), 1); continue; } } } else { if (group != sgroup) { - (void) printf(gettext("Attempt to change" + (void) printf(dgettext(TEXT_DOMAIN, "Attempt to change" "configuration in" "dfstab: line %d: %s\n"), list->lineno, list->origline); add_syntax_comment(root, list->origline, - gettext("Attempt to change configuration"), 1); + dgettext(TEXT_DOMAIN, + "Attempt to change configuration"), + 1); continue; } /* its the same group but could have changed options */ @@ -1295,7 +1303,8 @@ parse_sharetab(void) } } if (share == NULL) - (void) printf(gettext("Problem with transient: %s\n"), + (void) printf(dgettext(TEXT_DOMAIN, + "Problem with transient: %s\n"), sa_errorstr(err)); if (share != NULL) set_node_attr(share, "shared", "true"); diff --git a/usr/src/lib/libshare/common/plugin.c b/usr/src/lib/libshare/common/plugin.c index 54b95d8fbb..4618090099 100644 --- a/usr/src/lib/libshare/common/plugin.c +++ b/usr/src/lib/libshare/common/plugin.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -109,7 +109,8 @@ proto_plugin_init() } } else { (void) fprintf(stderr, - gettext("Error in plugin for protocol %s: %s\n"), + dgettext(TEXT_DOMAIN, + "Error in plugin for protocol %s: %s\n"), dent->d_name, dlerror()); } } |