summaryrefslogtreecommitdiff
path: root/cpp/src/slice2rb/Main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/slice2rb/Main.cpp')
-rw-r--r--cpp/src/slice2rb/Main.cpp26
1 files changed, 7 insertions, 19 deletions
diff --git a/cpp/src/slice2rb/Main.cpp b/cpp/src/slice2rb/Main.cpp
index da01726693a..2e91d3c1d8a 100644
--- a/cpp/src/slice2rb/Main.cpp
+++ b/cpp/src/slice2rb/Main.cpp
@@ -30,16 +30,6 @@ using namespace std;
using namespace Slice;
using namespace Slice::Ruby;
-//
-// Callback for Crtl-C signal handling
-//
-static IceUtilInternal::Output _out;
-
-static void closeCallback()
-{
- _out.close();
-}
-
void
usage(const char* n)
{
@@ -204,26 +194,24 @@ main(int argc, char* argv[])
}
SignalHandler::addFile(file);
- SignalHandler::setCallback(closeCallback);
-
- _out.open(file.c_str());
- if(!_out)
+ IceUtilInternal::Output out;
+ out.open(file.c_str());
+ if(!out)
{
cerr << argv[0] << ": can't open `" << file << "' for writing" << endl;
u->destroy();
return EXIT_FAILURE;
}
- printHeader(_out);
- _out << "\n# Generated from file `" << base << ".ice'\n";
+ printHeader(out);
+ out << "\n# Generated from file `" << base << ".ice'\n";
//
// Generate the Ruby mapping.
//
- generate(u, all, checksum, includePaths, _out);
+ generate(u, all, checksum, includePaths, out);
- _out.close();
- SignalHandler::setCallback(0);
+ out.close();
}
u->destroy();