aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-11-27 03:13:50 +0000
committerUlrich Drepper <drepper@redhat.com>2005-11-27 03:13:50 +0000
commitd00002ed88bb071d24f6e54b7ae6c77aca9bcc6b (patch)
tree1faec9ff68a6a2d9a9ddccca67ae7b545116fa76
parent3218d55b950ccb1e6422cb6abf6fd4a780170e43 (diff)
downloadglibc-d00002ed88bb071d24f6e54b7ae6c77aca9bcc6b.tar
glibc-d00002ed88bb071d24f6e54b7ae6c77aca9bcc6b.tar.gz
glibc-d00002ed88bb071d24f6e54b7ae6c77aca9bcc6b.tar.bz2
glibc-d00002ed88bb071d24f6e54b7ae6c77aca9bcc6b.zip
* nis/nis_lookup.c (nis_lookup): Mark RPCTIMEOUT as const. Pretty
printing.
-rw-r--r--ChangeLog3
-rw-r--r--nis/nis_lookup.c17
-rw-r--r--nis/nis_table.c2
3 files changed, 13 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 9f0e96fe63..15c0ecd136 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2005-11-26 Ulrich Drepper <drepper@redhat.com>
+ * nis/nis_lookup.c (nis_lookup): Mark RPCTIMEOUT as const. Pretty
+ printing.
+
* nis/nis_table.c (__create_ib_request): Use strdupa instead of
variable size array.
(RPCTIMEOUT): Mark as const.
diff --git a/nis/nis_lookup.c b/nis/nis_lookup.c
index 0b97e67a61..5f2fb59d79 100644
--- a/nis/nis_lookup.c
+++ b/nis/nis_lookup.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 1999, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@uni-paderborn.de>, 1997.
@@ -90,7 +90,7 @@ nis_lookup (const_nis_name name, const unsigned int flags)
do
{
- static struct timeval RPCTIMEOUT = {10, 0};
+ static const struct timeval RPCTIMEOUT = {10, 0};
enum clnt_stat result;
again:
@@ -107,8 +107,8 @@ nis_lookup (const_nis_name name, const unsigned int flags)
if (NIS_RES_STATUS (res) == NIS_SUCCESS)
{
- if (__type_of(NIS_RES_OBJECT (res)) == NIS_LINK_OBJ &&
- flags & FOLLOW_LINKS) /* We are following links */
+ if (__type_of(NIS_RES_OBJECT (res)) == NIS_LINK_OBJ
+ && (flags & FOLLOW_LINKS)) /* We are following links */
{
if (count_links)
free (req.ns_name);
@@ -137,16 +137,17 @@ nis_lookup (const_nis_name name, const unsigned int flags)
}
}
else
- if ((NIS_RES_STATUS (res) == NIS_SYSTEMERROR) ||
- (NIS_RES_STATUS (res) == NIS_NOSUCHNAME) ||
- (NIS_RES_STATUS (res) == NIS_NOT_ME))
+ if (NIS_RES_STATUS (res) == NIS_SYSTEMERROR
+ || NIS_RES_STATUS (res) == NIS_NOSUCHNAME
+ || NIS_RES_STATUS (res) == NIS_NOT_ME)
{
if (link_first_try)
{
__nisbind_destroy (&bptr);
nis_free_directory (dir);
- if (__nisfind_server (req.ns_name, &dir) != NIS_SUCCESS)
+ if (__nisfind_server (req.ns_name, &dir)
+ != NIS_SUCCESS)
return res;
if (__nisbind_create (&bptr,
diff --git a/nis/nis_table.c b/nis/nis_table.c
index 27efd5181a..abe47d09c1 100644
--- a/nis/nis_table.c
+++ b/nis/nis_table.c
@@ -137,7 +137,7 @@ __get_tablepath (char *name, dir_binding *bptr)
(caddr_t) &req, (xdrproc_t) _xdr_nis_result,
(caddr_t) &res, RPCTIMEOUT);
- char *cptr;
+ const char *cptr;
if (result == RPC_SUCCESS && NIS_RES_STATUS (&res) == NIS_SUCCESS
&& __type_of (NIS_RES_OBJECT (&res)) == NIS_TABLE_OBJ)
cptr = NIS_RES_OBJECT (&res)->TA_data.ta_path;