summaryrefslogtreecommitdiffstats
path: root/lib/Utils/popen_and_save_output.cpp
diff options
context:
space:
mode:
authorKarel Klic <kklic@redhat.com>2010-01-18 13:19:54 +0100
committerKarel Klic <kklic@redhat.com>2010-01-18 13:19:54 +0100
commit4267cbcc29781ddcac00e259dfe05f3a26fbc2ec (patch)
tree213e47138967f1e7af4ee9ff9a3f2ed861cb5815 /lib/Utils/popen_and_save_output.cpp
parentb2d1bd9e4f387c5a014d3002d741f25421c37aac (diff)
parentb41833ed61f7b579d2a46b26d261616c21a6ae32 (diff)
downloadabrt-4267cbcc29781ddcac00e259dfe05f3a26fbc2ec.tar.gz
abrt-4267cbcc29781ddcac00e259dfe05f3a26fbc2ec.tar.xz
abrt-4267cbcc29781ddcac00e259dfe05f3a26fbc2ec.zip
Merge branch 'master' of git://git.fedorahosted.org/git/abrt
Diffstat (limited to 'lib/Utils/popen_and_save_output.cpp')
-rw-r--r--lib/Utils/popen_and_save_output.cpp30
1 files changed, 0 insertions, 30 deletions
diff --git a/lib/Utils/popen_and_save_output.cpp b/lib/Utils/popen_and_save_output.cpp
deleted file mode 100644
index 4bcbcac4..00000000
--- a/lib/Utils/popen_and_save_output.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Utility routines.
- *
- * Licensed under GPLv2 or later, see file COPYING in this tarball for details.
- */
-#include "abrtlib.h"
-
-using namespace std;
-
-string popen_and_save_output(const char *cmd)
-{
- string result;
-
- FILE *fp = popen(cmd, "r");
- if (fp == NULL) /* fork or pipe failed; or out-of-mem */
- {
- return result;
- }
-
- size_t sz;
- char buf[BUFSIZ + 1];
- while ((sz = fread(buf, 1, sizeof(buf)-1, fp)) > 0)
- {
- buf[sz] = '\0';
- result += buf;
- }
- pclose(fp);
-
- return result;
-}