Skip to content
Snippets Groups Projects
Select Git revision
  • 8959de9f679cfd0436d731fd91b88a68b9a75fa6
  • max32xxx default protected
  • dw-cmsisdap-path
3 results

ioutil.c

Blame
  • ioutil.c 14.24 KiB
    /***************************************************************************
     *   Copyright (C) 2007-2008 by yvind Harboe                              *
     *                                                                         *
     *   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.             *
     ***************************************************************************/
    
    /* this file contains various functionality useful to standalone systems */
    
    #ifdef HAVE_CONFIG_H
    #include "config.h"
    #endif
    
    #include "log.h"
    #include "time_support.h"
    
    #ifdef HAVE_ARPA_INET_H
    #include <arpa/inet.h>
    #endif
    #ifdef HAVE_DIRENT_H
    #include <dirent.h>
    #endif
    #ifdef HAVE_NETDB_H
    #include <netdb.h>
    #endif
    #ifdef HAVE_NET_IF_H
    #include <net/if.h>
    #endif
    //#ifdef HAVE_NETINET_TCP_H
    //#include <netinet/tcp.h>
    //#endif
    #ifdef HAVE_SYS_IOCTL_H
    #include <sys/ioctl.h>
    #endif
    #ifdef HAVE_SYS_STAT_H
    #include <sys/stat.h>
    #endif
    #ifdef HAVE_IFADDRS_H
    #include <ifaddrs.h>
    #endif
    #ifdef HAVE_MALLOC_H
    #if !BUILD_ECOSBOARD
    #include <malloc.h>
    #endif
    #endif
    
    
    int handle_rm_command(struct command_context_s *cmd_ctx, char *cmd,
    		char **args, int argc)
    {
    	if (argc != 1)
    	{
    		command_print(cmd_ctx, "rm <filename>");
    		return ERROR_INVALID_ARGUMENTS;
    	}
    
    	if (unlink(args[0]) != 0)
    	{