Thread (31 messages) flat view 31 messages, 3 authors, 2016-06-15
STALE3717d

Revision v1 of 4 in this series.

Revisions (4)
  1. v1 current
  2. v2 [diff vs current]
  3. v4 [diff vs current]
  4. v6 [diff vs current]

[PATCH 09/18] Check return value of open and remove import of unused open2

From: Célestin Matte <hidden>
Date: 2016-06-15 22:57:34
Subsystem: the rest · Maintainer: Linus Torvalds

Signed-off-by: Célestin Matte <redacted>
Signed-off-by: Matthieu Moy <redacted>
---
 contrib/mw-to-git/git-remote-mediawiki.perl |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl
index ae6dd2e..1c34ada 100755
--- a/contrib/mw-to-git/git-remote-mediawiki.perl
+++ b/contrib/mw-to-git/git-remote-mediawiki.perl
@@ -22,7 +22,6 @@ binmode STDERR, ":encoding(UTF-8)";
 binmode STDOUT, ":encoding(UTF-8)";
 
 use URI::Escape;
-use IPC::Open2;
 use Readonly;
 
 # Mediawiki filenames can contain forward slashes. This variable decides by which pattern they should be replaced
@@ -338,7 +337,8 @@ sub get_mw_pages {
 sub run_git {
 	my $args = shift;
 	my $encoding = (shift || "encoding(UTF-8)");
-	open(my $git, "-|:$encoding", "git " . $args);
+	open(my $git, "-|:$encoding", "git " . $args)
+	    or die "Unable to open: $!\n";
 	my $res = do { 
 		local $/ = undef;
 		<$git>
-- 
1.7.9.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help