Return-Path: linux-nfs-owner@vger.kernel.org Received: from dgate20.ts.fujitsu.com ([80.70.172.51]:64200 "EHLO dgate20.ts.fujitsu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751565AbaKEUW6 (ORCPT ); Wed, 5 Nov 2014 15:22:58 -0500 Message-Id: <61eb00$5diu09@dgate20u.abg.fsc.net> Date: 05 Nov 2014 21:22:56 +0100 From: bstroesser@ts.fujitsu.com To: neilb@suse.de, linux-nfs@vger.kernel.org Cc: bfields@fieldses.org, bstroesser@ts.fujitsu.com Subject: [nfs-utils] [PATCH 1/3] rpc.mountd: set nonblocking mode if no libtirpc Content-Type: text/plain; charset=us-ascii Sender: linux-nfs-owner@vger.kernel.org List-ID: RnJvbTogQm9kbyBTdHJvZXNzZXIgPGJzdHJvZXNzZXJAdHMuZnVqaXRzdS5jb20+CkRhdGU6 IFRodSwgMDkgT2N0IDIwMTQgMTM6MDY6MTkgKzAyMDAKU3ViamVjdDogW25mcy11dGlsc10g W1BBVENIIDEvM10gcnBjLm1vdW50ZDogc2V0IG5vbmJsb2NraW5nIG1vZGUgaWYgbm8gbGli dGlycGMKCklmIG1vdW50ZCBpcyBidWlsdCB3aXRob3V0IGxpYnRpcnBjIGFuZCBpdCBpcyBz dGFydGVkIHVzaW5nICItcCBYWFgiIG9wdGlvbiwKdGhlIHRjcCBsaXN0ZW5lcnMgYW5kIHRo ZSBzb2NrZXRzIHdhaXRpbmcgZm9yIFVEUCBtZXNzYWdlcyBhcmUgbm90IGluCm5vbi1ibG9j a2luZyBtb2RlLiBUaHVzIGlmIHJ1bm5pbmcgd2l0aCBtdWx0aXBsZSB0aHJlYWRzICgtdCBY WCksCmFsbCB0aHJlYWRzIHdpbGwgd2FrZSB1cCBmcm9tIHNlbGVjdCBvbiBhIGNvbm5lY3Rp b24gcmVxdWVzdCBvciBhIFVEUCBtZXNzYWdlLApidXQgb25seSBvbmUgdGhyZWFkIHdpbGwg c3VjY2VlZC4gQWxsIG90aGVyc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