All of lore.kernel.org
 help / color / mirror / Atom feed
From: Glauber de Oliveira Costa <gcosta@redhat.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] Reporting wrong status for non-existant files
Date: Mon, 23 Oct 2006 16:45:16 -0300	[thread overview]
Message-ID: <20061023194516.GD14072@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 245 bytes --]

Hi,

The block scripts under tools/examples is not reporting the proper
information in the event of a non-exitent file being passed on, like in
"file:/nonexistant,hda,w".

Thanks,

-- 
Glauber de Oliveira Costa
Red Hat Inc.
"Free as in Freedom"

[-- Attachment #2: filenotfound.patch --]
[-- Type: text/plain, Size: 883 bytes --]

# HG changeset patch
# User root@et-virt07.lab.boston.redhat.com
# Date 1161631865 14400
# Node ID 6b28d144c5814b5206592e93bcea4b7d0a752e8a
# Parent  29b02d929b7e4df6016c16ebba71d6d73462882e
The block script is reporting the file as non-writable, even if it does
not exists

diff -r 29b02d929b7e -r 6b28d144c581 tools/examples/block
--- a/tools/examples/block	Mon Oct 23 14:42:52 2006 +0100
+++ b/tools/examples/block	Mon Oct 23 15:31:05 2006 -0400
@@ -266,7 +266,15 @@ case "$command" in
 
         claim_lock "block"
 
-        if [ "$mode" == 'w' ] && ! stat "$file" -c %A | grep -q w
+        fstat=$(stat "$file" -c %A)
+        if [ "$?" == '1' ];
+        then
+          release_lock "block"
+          ebusy \
+"File $file not found."
+        fi
+
+        if [ "$mode" == 'w' ] && ! echo $fstat | grep -q w
         then
           release_lock "block"
           ebusy \

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

             reply	other threads:[~2006-10-23 19:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-23 19:45 Glauber de Oliveira Costa [this message]
2006-10-24 16:15 ` [PATCH] Reporting wrong status for non-existant files Ewan Mellor
2006-10-25 12:57   ` Glauber de Oliveira Costa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061023194516.GD14072@redhat.com \
    --to=gcosta@redhat.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.