diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-08-15 18:54:44 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-08-15 18:54:44 +0000 |
commit | de10237719db8101cd9487b257761d4721f857ab (patch) | |
tree | 7f315aa67f37c64626f881a94abc3d0d1da6e7e5 /source4/lib | |
parent | 8e4ab747b02207671203d40cd2a78692da78faef (diff) | |
download | samba-de10237719db8101cd9487b257761d4721f857ab.tar.gz samba-de10237719db8101cd9487b257761d4721f857ab.tar.xz samba-de10237719db8101cd9487b257761d4721f857ab.zip |
more fixes from the IRIX compiler (thanks herb!)
(This used to be commit 02d068ba7d81d6db25122144981c63f74ad44025)
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/charcnv.c | 2 | ||||
-rw-r--r-- | source4/lib/tdb/tdb.c | 4 | ||||
-rw-r--r-- | source4/lib/tdb/tdb.h | 2 | ||||
-rw-r--r-- | source4/lib/util_sock.c | 5 | ||||
-rw-r--r-- | source4/lib/util_str.c | 3 | ||||
-rw-r--r-- | source4/lib/util_unistr.c | 6 | ||||
-rw-r--r-- | source4/lib/util_uuid.c | 1 |
7 files changed, 7 insertions, 16 deletions
diff --git a/source4/lib/charcnv.c b/source4/lib/charcnv.c index 622de26ab87..72277b4f2e6 100644 --- a/source4/lib/charcnv.c +++ b/source4/lib/charcnv.c @@ -151,7 +151,7 @@ ssize_t convert_string(charset_t from, charset_t to, o_len=destlen; retval = smb_iconv(descriptor, &inbuf, &i_len, &outbuf, &o_len); if(retval==(size_t)-1) { - const char *reason="unknown error"; + const char *reason; switch(errno) { case EINVAL: reason="Incomplete multibyte sequence"; diff --git a/source4/lib/tdb/tdb.c b/source4/lib/tdb/tdb.c index 097209ff7a9..513fbce5194 100644 --- a/source4/lib/tdb/tdb.c +++ b/source4/lib/tdb/tdb.c @@ -166,9 +166,9 @@ struct list_struct { a blocking lock on SIGALRM. ***************************************************************/ -static sig_atomic_t *palarm_fired; +static SIG_ATOMIC_T *palarm_fired; -void tdb_set_lock_alarm(sig_atomic_t *palarm) +void tdb_set_lock_alarm(SIG_ATOMIC_T *palarm) { palarm_fired = palarm; } diff --git a/source4/lib/tdb/tdb.h b/source4/lib/tdb/tdb.h index 6f3b1ff7562..720066f1b37 100644 --- a/source4/lib/tdb/tdb.h +++ b/source4/lib/tdb/tdb.h @@ -127,7 +127,7 @@ int tdb_lockall(TDB_CONTEXT *tdb); void tdb_unlockall(TDB_CONTEXT *tdb); /* Low level locking functions: use with care */ -void tdb_set_lock_alarm(sig_atomic_t *palarm); +void tdb_set_lock_alarm(SIG_ATOMIC_T *palarm); int tdb_chainlock(TDB_CONTEXT *tdb, TDB_DATA key); int tdb_chainunlock(TDB_CONTEXT *tdb, TDB_DATA key); diff --git a/source4/lib/util_sock.c b/source4/lib/util_sock.c index 42dc04f6c8b..83622908047 100644 --- a/source4/lib/util_sock.c +++ b/source4/lib/util_sock.c @@ -439,7 +439,6 @@ static BOOL matchname(char *remotehost, struct in_addr addr) char *get_socket_name(TALLOC_CTX *mem_ctx, int fd, BOOL force_lookup) { char *name_buf; - char *addr_buf; struct hostent *hp; struct in_addr addr; char *p; @@ -457,8 +456,6 @@ char *get_socket_name(TALLOC_CTX *mem_ctx, int fd, BOOL force_lookup) name_buf = talloc_strdup(mem_ctx, "UNKNOWN"); if (fd == -1) return name_buf; - addr_buf = talloc_strdup(mem_ctx, p); - addr = *interpret_addr2(mem_ctx, p); /* Look up the remote host name. */ @@ -473,7 +470,7 @@ char *get_socket_name(TALLOC_CTX *mem_ctx, int fd, BOOL force_lookup) } } - alpha_strcpy(name_buf, name_buf, "_-.", sizeof(name_buf)); + alpha_strcpy(name_buf, name_buf, "_-.", strlen(name_buf)+1); if (strstr(name_buf,"..")) { name_buf = talloc_strdup(mem_ctx, "UNKNOWN"); } diff --git a/source4/lib/util_str.c b/source4/lib/util_str.c index 19857cff865..f689ae43554 100644 --- a/source4/lib/util_str.c +++ b/source4/lib/util_str.c @@ -651,11 +651,8 @@ BOOL in_list(const char *s, const char *list, BOOL casesensitive) **/ static BOOL string_init(char **dest,const char *src) { - size_t l; if (!src) src = ""; - l = strlen(src); - (*dest) = strdup(src); if ((*dest) == NULL) { DEBUG(0,("Out of memory in string_init\n")); diff --git a/source4/lib/util_unistr.c b/source4/lib/util_unistr.c index e5d2b8c3db5..71a67eb1599 100644 --- a/source4/lib/util_unistr.c +++ b/source4/lib/util_unistr.c @@ -383,10 +383,9 @@ wide strstr() const smb_ucs2_t *strstr_w(const smb_ucs2_t *s, const smb_ucs2_t *ins) { const smb_ucs2_t *r; - size_t slen, inslen; + size_t inslen; if (!s || !*s || !ins || !*ins) return NULL; - slen = strlen_w(s); inslen = strlen_w(ins); r = s; while ((r = strchr_w(r, *ins))) { @@ -663,10 +662,9 @@ const smb_ucs2_t *strpbrk_wa(const smb_ucs2_t *s, const char *p) const smb_ucs2_t *strstr_wa(const smb_ucs2_t *s, const char *ins) { const smb_ucs2_t *r; - size_t slen, inslen; + size_t inslen; if (!s || !*s || !ins || !*ins) return NULL; - slen = strlen_w(s); inslen = strlen(ins); r = s; while ((r = strchr_w(r, UCS2_CHAR(*ins)))) { diff --git a/source4/lib/util_uuid.c b/source4/lib/util_uuid.c index 76eb93a9b80..25b51af6ba9 100644 --- a/source4/lib/util_uuid.c +++ b/source4/lib/util_uuid.c @@ -93,7 +93,6 @@ const char *uuid_string(TALLOC_CTX *mem_ctx, const GUID in) char *out; uuid_unpack(in, &uu); - if (!out) return NULL; out = talloc_asprintf(mem_ctx, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", uu.time_low, uu.time_mid, uu.time_hi_and_version, |