From: Frank Lichtenheld Date: Mon, 19 Mar 2007 15:56:01 +0000 (+0100) Subject: cvsserver: Abort if connect to database fails X-Git-Tag: v1.5.2-rc0~34^2~7 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/920a449af5a6b4ecbf01a5a4e3bc4894ad302634?hp=--cc cvsserver: Abort if connect to database fails Currently all calls to the database backend make no error checking or handling at all. At least abort if the connection to the database failed since there is really no way we could do anything useful after that. Signed-off-by: Frank Lichtenheld Signed-off-by: Junio C Hamano --- 920a449af5a6b4ecbf01a5a4e3bc4894ad302634 diff --git a/git-cvsserver.perl b/git-cvsserver.perl index 6d10aa3343..941a91bcac 100755 --- a/git-cvsserver.perl +++ b/git-cvsserver.perl @@ -2168,6 +2168,7 @@ sub new $self->{dbh} = DBI->connect("$self->{dbdriver}:dbname=$self->{dbname}", $self->{dbuser}, $self->{dbpass}); + die "Error connecting to database\n" unless defined $self->{dbh}; $self->{tables} = {}; foreach my $table ( $self->{dbh}->tables )