Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Wood <thomas.wood@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t] lib: fix igt_reset_connectors
Date: Mon, 24 Nov 2014 14:16:25 +0000	[thread overview]
Message-ID: <1416838585-8324-1-git-send-email-thomas.wood@intel.com> (raw)

Use igt_debugfs_open to open the connector file, since the
forced_connectors array now only stores the connector path relative to
the debugfs path. Also add some extra error checking to ensure a test
failure if the reset fails.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85829
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
---
 lib/igt_kms.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 5edd5ec..cba0c27 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1773,8 +1773,8 @@ void igt_reset_connectors(void)
 	 * functions that are not safe to call in signal handlers */
 
 	for (tmp = forced_connectors; *tmp; tmp++) {
-		int fd = open(*tmp, O_WRONLY | O_TRUNC);
-		write(fd, "unspecified", 11);
+		int fd = igt_debugfs_open(*tmp, O_WRONLY | O_TRUNC);
+		igt_assert(write(fd, "unspecified", 11) == 11);
 		close(fd);
 	}
 }
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

             reply	other threads:[~2014-11-24 14:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-24 14:16 Thomas Wood [this message]
2014-11-25  8:35 ` [PATCH i-g-t] lib: fix igt_reset_connectors Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1416838585-8324-1-git-send-email-thomas.wood@intel.com \
    --to=thomas.wood@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox