about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-09-11 18:59:45 -0700
committerEric Wong <normalperson@yhbt.net>2008-09-11 18:59:45 -0700
commit71a440d04e6c9496062ed123708b71c051a22290 (patch)
treebced673093ef828ba6e8fa9124b35e5fc6114227
parentc06411e24f7323688e9036db138caf307ad025f0 (diff)
downloadmogilefs-client-71a440d04e6c9496062ed123708b71c051a22290.tar.gz
SIGPIPE is very handy for scripting, and I hit SIGINT
in the console pretty often, too; so don't spew to
STDERR when we catch these signals.
-rwxr-xr-xbin/mog3
1 files changed, 3 insertions, 0 deletions
diff --git a/bin/mog b/bin/mog
index 1dff39c..06bd481 100755
--- a/bin/mog
+++ b/bin/mog
@@ -2,6 +2,9 @@
 require 'mogilefs'
 require 'optparse'
 
+trap('INT') { exit 130 }
+trap('PIPE') { exit 0 }
+
 # this is to be compatible with config files used by the Perl tools
 def parse_config_file!(path, overwrite = false)
   dest = {}