61 lines
1.9 KiB
Diff
61 lines
1.9 KiB
Diff
|
From f7ecc01d4e773ac532c3fc990833ca4d1cda6a7b Mon Sep 17 00:00:00 2001
|
|||
|
From: Andrea Brancaleoni <miwaxe@gmail.com>
|
|||
|
Date: Mon, 24 Aug 2015 18:25:10 +0200
|
|||
|
Subject: [PATCH] getmntent fix
|
|||
|
|
|||
|
---
|
|||
|
lib/sbuild/mntstream.cc | 15 ++-------------
|
|||
|
lib/sbuild/mntstream.h | 3 +--
|
|||
|
2 files changed, 3 insertions(+), 15 deletions(-)
|
|||
|
|
|||
|
diff --git lib/sbuild/mntstream.cc lib/sbuild/mntstream.cc
|
|||
|
index 7f5e7d4..44b472d 100644
|
|||
|
--- lib/sbuild/mntstream.cc
|
|||
|
+++ lib/sbuild/mntstream.cc
|
|||
|
@@ -31,9 +31,7 @@ namespace sbuild
|
|||
|
error<mntstream::error_code>::error_strings =
|
|||
|
{
|
|||
|
// TRANSLATORS: %1% = mount file name
|
|||
|
- {mntstream::MNT_OPEN, N_("Failed to open mount file ‘%1%’")},
|
|||
|
- // TRANSLATORS: %1% = mount file name
|
|||
|
- {mntstream::MNT_READ, N_("Failed to read mount file ‘%1%’")}
|
|||
|
+ {mntstream::MNT_OPEN, N_("Failed to open mount file ‘%1%’")}
|
|||
|
};
|
|||
|
|
|||
|
mntstream::mntentry::mntentry (const struct mntent& entry):
|
|||
|
@@ -94,16 +92,7 @@ namespace sbuild
|
|||
|
errno = 0;
|
|||
|
entry = getmntent(mntfile);
|
|||
|
|
|||
|
- if (entry == 0) // EOF or error
|
|||
|
- {
|
|||
|
- //std::cerr << "Mount file read error: ";
|
|||
|
- if (errno) // error
|
|||
|
- {
|
|||
|
- this->error_status = true;
|
|||
|
- throw error(this->file, MNT_READ, strerror(errno));
|
|||
|
- }
|
|||
|
- return;
|
|||
|
- }
|
|||
|
+ if (entry == 0) return;
|
|||
|
|
|||
|
mntentry newentry(*entry); // make a mntentry
|
|||
|
this->data.push_back(newentry); // push onto the end of the list
|
|||
|
diff --git lib/sbuild/mntstream.h lib/sbuild/mntstream.h
|
|||
|
index a406d6e..7e52559 100644
|
|||
|
--- lib/sbuild/mntstream.h
|
|||
|
+++ lib/sbuild/mntstream.h
|
|||
|
@@ -49,8 +49,7 @@ namespace sbuild
|
|||
|
/// Error codes.
|
|||
|
enum error_code
|
|||
|
{
|
|||
|
- MNT_OPEN, ///< Failed to open mount file.
|
|||
|
- MNT_READ ///< Failed to read mount file.
|
|||
|
+ MNT_OPEN ///< Failed to open mount file.
|
|||
|
};
|
|||
|
|
|||
|
/// Exception type.
|
|||
|
--
|
|||
|
2.5.0
|
|||
|
|