diff options
author | Kim Hagen <kim.sidney@gmail.com> | 2017-08-28 13:32:42 +0200 |
---|---|---|
committer | Kim Hagen <kim.sidney@gmail.com> | 2017-08-28 13:32:42 +0200 |
commit | 512e68c8161d1ccbd4ff819d9b1d622fee650215 (patch) | |
tree | 8da837549dae7158dbeac545b15ae0b1177ca02a | |
parent | 631b04c197efd9b20e66fa57ea4869525557c013 (diff) | |
download | vyatta-cfg-512e68c8161d1ccbd4ff819d9b1d622fee650215.tar.gz vyatta-cfg-512e68c8161d1ccbd4ff819d9b1d622fee650215.zip |
fix compilation errors on newer gcc
-rwxr-xr-x | debian/rules | 1 | ||||
-rw-r--r-- | src/cstore/unionfs/cstore-unionfs.cpp | 10 |
2 files changed, 6 insertions, 5 deletions
diff --git a/debian/rules b/debian/rules index 59eaab9..42dc3ce 100755 --- a/debian/rules +++ b/debian/rules @@ -4,6 +4,7 @@ export DH_OPTIONS ## uncomment to enable hardening #export DEB_BUILD_HARDENING=1 +CXXFLAGS += -Wno-deprecated-declarations cfg_opts := --prefix=/opt/vyatta cfg_opts += --libdir=/usr/lib diff --git a/src/cstore/unionfs/cstore-unionfs.cpp b/src/cstore/unionfs/cstore-unionfs.cpp index 858a204..a990f03 100644 --- a/src/cstore/unionfs/cstore-unionfs.cpp +++ b/src/cstore/unionfs/cstore-unionfs.cpp @@ -179,7 +179,7 @@ vector<int> getActiveCommits() int pid = atoi(dirp->d_name); if (pid > 0) { string command_path = string("/proc/") + dirp->d_name + "/cmdline"; - ifstream command_file(command_path.c_str()); + std::ifstream command_file(command_path.c_str()); string command_line; getline(command_file, command_line); if (!command_line.empty()) { @@ -1513,8 +1513,8 @@ UnionfsCstore::write_file(const char *file, const string& data, bool append) b_fs::create_directories(ppath.path_cstr()); // write the file - ofstream fout; - fout.exceptions(ofstream::failbit | ofstream::badbit); + std::ofstream fout; + fout.exceptions(std::ofstream::failbit | std::ofstream::badbit); ios_base::openmode mflags = ios_base::out; mflags |= ((!append || !path_exists(file)) ? ios_base::trunc : ios_base::app); // truncate or append @@ -1543,7 +1543,7 @@ UnionfsCstore::read_whole_file(const FsPath& fpath, string& data) } stringbuf sbuf; - ifstream fin(fpath.path_cstr()); + std::ifstream fin(fpath.path_cstr()); fin >> &sbuf; fin.close(); /* note: if file contains just a newline => (eof() && fail()) @@ -1605,7 +1605,7 @@ UnionfsCstore::find_line_in_file(const FsPath& file, const string& line) { bool ret = false; try { - ifstream fin(file.path_cstr()); + std::ifstream fin(file.path_cstr()); while (!fin.eof() && !fin.bad() && !fin.fail()) { string in; getline(fin, in); |