X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fnss-myhostname%2Fnss-myhostname.c;h=b0fb8323ad0db8d472bde63ea9700f7ad51afe1a;hp=83180ad80532713dc6bb9ca2c23e21629568b026;hb=d2f1f23ad2636cf05589a67b5229c7fd604bc21f;hpb=f274ece0f76b5709408821e317e87aef76123db6
diff --git a/src/nss-myhostname/nss-myhostname.c b/src/nss-myhostname/nss-myhostname.c
index 83180ad80..b0fb8323a 100644
--- a/src/nss-myhostname/nss-myhostname.c
+++ b/src/nss-myhostname/nss-myhostname.c
@@ -1,23 +1,22 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
- This file is part of nss-myhostname.
+ This file is part of systemd.
Copyright 2008-2011 Lennart Poettering
- nss-myhostname is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public License
- as published by the Free Software Foundation; either version 2.1 of
- the License, or (at your option) any later version.
+ systemd is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
- nss-myhostname is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
+ systemd is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with nss-myhostname; If not, see
- .
+ You should have received a copy of the GNU Lesser General Public License
+ along with systemd; If not, see .
***/
#include
@@ -177,7 +176,11 @@ enum nss_status _nss_myhostname_gethostbyname4_r(
/* Verify the size matches */
assert(idx == ms);
- *pat = r_tuple_prev;
+ /* Nscd expects us to store the first record in **pat. */
+ if (*pat)
+ **pat = *r_tuple_prev;
+ else
+ *pat = r_tuple_prev;
if (ttlp)
*ttlp = 0;