X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fdebugger.c;h=aab7797380fed51f52eaaea85edeee87e0179290;hb=d52355bcda20563736bd83aed3ab58e534672cb5;hp=7b9c0b925fb73215d04af10992a88777a407ee6a;hpb=c246143823df29e9ce4c5115c647a47954dea883;p=pspp-builds.git diff --git a/src/ui/debugger.c b/src/ui/debugger.c index 7b9c0b92..aab77973 100644 --- a/src/ui/debugger.c +++ b/src/ui/debugger.c @@ -1,20 +1,18 @@ -/* PSPP - computes sample statistics. +/* PSPP - a program for statistical analysis. Copyright (C) 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + along with this program. If not, see . */ #include @@ -28,7 +26,7 @@ #include #include -/* Fork, start gdb and connect to the parent process. +/* Fork, start gdb and connect to the parent process. If that happens successfully, then this function does not return, but exits with EXIT_FAILURE. Otherwise it returns. */ @@ -40,12 +38,12 @@ connect_debugger (void) snprintf (pidstr, 20, "%d", getpid ()); pid = fork (); - if ( pid == -1 ) + if ( pid == -1 ) { perror ("Cannot fork"); return ; } - if ( pid == 0 ) + if ( pid == 0 ) { /* child */ execlp ("gdb", "gdb", "-p", pidstr, NULL); @@ -56,10 +54,10 @@ connect_debugger (void) { int status; wait (&status); - if ( EXIT_SUCCESS != WEXITSTATUS (status) ) + if ( EXIT_SUCCESS != WEXITSTATUS (status) ) return ; } - + exit (EXIT_FAILURE); } @@ -67,8 +65,8 @@ connect_debugger (void) /* Don't know how to connect to gdb. Just return. */ -void -connect_debugger (void) +void +connect_debugger (void) { } #endif /* !(HAVE_SYS_TYPES_H && HAVE_SYS_WAIT_H) */