X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fmain.c;h=a36e6b55fad8f1cf4ee0a65511e9692e2c6bf880;hb=382148e4dd437978997d668f6ec715ddcec1c46e;hp=c2f30035f36916e5babf2002d72f2c9dff1556a8;hpb=0fc19255c365a59acf4683d177bacf662e84d4f1;p=fw%2Fopenocd diff --git a/src/main.c b/src/main.c index c2f30035f..a36e6b55f 100644 --- a/src/main.c +++ b/src/main.c @@ -1,40 +1,15 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + /*************************************************************************** * Copyright (C) 2005 by Dominic Rath * * Dominic.Rath@gmx.de * - * * - * 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 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., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ - #ifdef HAVE_CONFIG_H #include "config.h" #endif - -#if !BUILD_HTTPD -/* implementations of OpenOCD that uses multithreading needs to know when - * OpenOCD is sleeping. No-op in vanilla OpenOCD - */ -void openocd_sleep_prelude(void) -{ -} - -void openocd_sleep_postlude(void) -{ -} -#endif +#include "openocd.h" +#include "helper/system.h" /* This is the main entry for developer PC hosted OpenOCD. * @@ -45,9 +20,11 @@ void openocd_sleep_postlude(void) * Those applications will have their own main() implementation * and use bits and pieces from openocd.c. */ -extern int openocd_main(int argc, char *argv[]); - int main(int argc, char *argv[]) { + /* disable buffering otherwise piping to logs causes problems work */ + setvbuf(stdout, NULL, _IONBF, 0); + setvbuf(stderr, NULL, _IONBF, 0); + return openocd_main(argc, argv); }