~kris/9p

disco

921f78670d7e514f117b42905e7487f95f88cc28 — Sean Hinchee 9 years ago 76de318
forget to test build, fixed
2 files changed, 6 insertions(+), 4 deletions(-)

M config.go
M helper.go
M config.go => config.go +1 -1
@@ 79,7 79,7 @@ func CreateConfig() {
	if plan9 {
		password = GetPass()
		
		err = Rawoff()
		err = RawOff()
		if err != nil {
			fmt.Println("Failed to set rawoff")
		}

M helper.go => helper.go +5 -3
@@ 2,11 2,13 @@ package main

import (
	"log"
	"os"
	"os/exec"
	"strings"
	"time"
	"fmt"
	"bitbucket.org/henesy/disco/DiscordGo"
	"bufio"
)

//HexColor is a struct gives RGB values


@@ 95,7 97,7 @@ func dis(a, b int) float64 {
	return float64((a - b) * (a - b))
}

func Rawon() {
func Rawon() error {
	consctl, err := os.OpenFile("/dev/consctl", os.O_WRONLY, 0200)
	if err != nil {
		/* not on Plan 9 */


@@ 112,7 114,7 @@ func Rawon() {
	return nil
}

func RawOff() {
func RawOff() error {
	consctl, err := os.OpenFile("/dev/consctl", os.O_WRONLY, 0200)
	if err != nil {
		/* not on Plan 9 */


@@ 128,7 130,7 @@ func RawOff() {
	return nil
}

func GetPass() {
func GetPass() string {
	cons, err := os.OpenFile("/dev/cons", os.O_RDWR, 0600)
	if err != nil {
		fmt.Println("Failed to open /dev/cons")