From: Simon J Mudd Date: Mon, 12 Jan 2015 16:55:47 +0000 (+0100) Subject: log success/failure to change ps.setup_instruments X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;h=d6ee7b071e88af51731e786b840e47840d100a77;p=pstop.git log success/failure to change ps.setup_instruments --- diff --git a/p_s/setup_instruments/setup_instruments.go b/p_s/setup_instruments/setup_instruments.go index c92b6df..595e75a 100644 --- a/p_s/setup_instruments/setup_instruments.go +++ b/p_s/setup_instruments/setup_instruments.go @@ -33,8 +33,6 @@ func (si *SetupInstruments) EnableMutexMonitoring(dbh *sql.DB) { rows, err := dbh.Query(sql) if err != nil { log.Fatal(err) - - } defer rows.Close() @@ -69,11 +67,14 @@ func (si *SetupInstruments) EnableMutexMonitoring(dbh *sql.DB) { log.Fatal(err) } break - } count++ } - lib.Logger.Println(count, "rows changed in p_s.setup_instruments") + if si.update_succeeded { + lib.Logger.Println(count, "rows changed in p_s.setup_instruments") + } else { + lib.Logger.Println( "Insufficient privileges to UPDATE setup_instruments: " . err.String() ) + } } // restore any changed rows back to their original state