[gvfs] pty_open: Prevent build warnings
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] pty_open: Prevent build warnings
- Date: Thu, 10 May 2018 09:26:47 +0000 (UTC)
commit 31c0fcbf8ae8339c1f18c1a4f54020a93ff1d9e1
Author: Ondrej Holy <oholy redhat com>
Date: Thu May 10 11:20:46 2018 +0200
pty_open: Prevent build warnings
Prevent the following build warning which is shown in some cases:
warning: ignoring return value of 'chdir', declared with attribute
warn_unused_result [-Wunused-result]
daemon/pty_open.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/daemon/pty_open.c b/daemon/pty_open.c
index e0402d8..5d146a1 100644
--- a/daemon/pty_open.c
+++ b/daemon/pty_open.c
@@ -355,7 +355,9 @@ _pty_run_on_pty(int fd, gboolean login,
/* Change to the requested directory. */
if (directory != NULL) {
- chdir(directory);
+ if (chdir(directory) == -1) {
+ g_warning ("Error changing directory.");
+ }
}
#ifdef HAVE_UTMP_H
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]