Permalink
Browse files

remove /dev/nvidia0 and /dev/nvidiactl after switching off nvidia card

  • Loading branch information...
hni committed Jun 8, 2012
1 parent 85636d1 commit 26f23f29441045bdaac7f0e4a8e46d3f67247e65
Showing with 11 additions and 1 deletion.
  1. +11 −1 src/switch/switching.c
View
@@ -18,7 +18,9 @@
* along with Bumblebee. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <errno.h>
#include <stddef.h>
+#include <stdio.h>
#include <string.h>
#include "../bblogger.h"
#include "switching.h"
@@ -81,7 +83,15 @@ enum switch_state switch_off(void) {
}
bb_log(LOG_INFO, "Switching dedicated card OFF [%s]\n", switcher->name);
switcher->off();
+
+ if (remove("/dev/nvidia0") == -1) {
+ bb_log(LOG_WARNING, "Could not delete /dev/nvidia0: %s\n", strerror(errno));
+ }
+ if (remove("/dev/nvidiactl") == -1) {
+ bb_log(LOG_WARNING, "Could not delete /dev/nvidiactl: %s\n", strerror(errno));
+ }
+
return switcher->status();
}
return SWITCH_UNAVAIL;
-}
+}

0 comments on commit 26f23f2

Please sign in to comment.