* [infiniband-diags] [1/3] make libibnetdisc default behavior to overwrite a cache
@ 2010-04-19 18:43 Al Chu
[not found] ` <1271702587.17987.212.camel-X2zTWyBD0EhliZ7u+bvwcg@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Al Chu @ 2010-04-19 18:43 UTC (permalink / raw)
To: Sasha Khapyorsky; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
[-- Attachment #1: Type: text/plain, Size: 287 bytes --]
Hey Sasha,
As discussed in a previous thread, this patch makes the default caching
behavior in libibnetdisc to overwrite a previous cache.
Al
--
Albert Chu
chu11-i2BcT+NCU+M@public.gmane.org
Computer Scientist
High Performance Systems Division
Lawrence Livermore National Laboratory
[-- Attachment #2: 0001-make-libibnetdisc-default-behavior-to-overwrite-a-ca.patch --]
[-- Type: message/rfc822, Size: 1143 bytes --]
From: Albert Chu <chu11-i2BcT+NCU+M@public.gmane.org>
Subject: [PATCH] make libibnetdisc default behavior to overwrite a cache
Date: Mon, 19 Apr 2010 10:52:14 -0700
Message-ID: <1271702059.17987.211.camel-X2zTWyBD0EhliZ7u+bvwcg@public.gmane.org>
Signed-off-by: Albert Chu <chu11-i2BcT+NCU+M@public.gmane.org>
---
.../libibnetdisc/src/ibnetdisc_cache.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/infiniband-diags/libibnetdisc/src/ibnetdisc_cache.c b/infiniband-diags/libibnetdisc/src/ibnetdisc_cache.c
index 5acb8f6..e05ce99 100644
--- a/infiniband-diags/libibnetdisc/src/ibnetdisc_cache.c
+++ b/infiniband-diags/libibnetdisc/src/ibnetdisc_cache.c
@@ -889,8 +889,11 @@ int ibnd_cache_fabric(ibnd_fabric_t * fabric, const char *file,
}
if (!stat(file, &statbuf)) {
- IBND_DEBUG("file '%s' already exists\n", file);
- return -1;
+ if (unlink(file) < 0) {
+ IBND_DEBUG("error removing '%s': %s\n",
+ file, strerror(errno));
+ return -1;
+ }
}
if ((fd = open(file, O_CREAT | O_EXCL | O_WRONLY, 0644)) < 0) {
--
1.5.4.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-06-14 11:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-19 18:43 [infiniband-diags] [1/3] make libibnetdisc default behavior to overwrite a cache Al Chu
[not found] ` <1271702587.17987.212.camel-X2zTWyBD0EhliZ7u+bvwcg@public.gmane.org>
2010-06-14 11:34 ` Sasha Khapyorsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox