source: rtems/cpukit/libmisc/shell/main_chmod.c @ 2eeb648c

4.104.114.95
Last change on this file since 2eeb648c was 2eeb648c, checked in by Chris Johns <chrisj@…>, on 12/17/07 at 00:12:01

2007-12-17 Chris Johns <chrisj@…>

  • libnetworking/rtems/tftp.h: Provide a decl to the TFTP file system opts table.
  • libnetworking/rtems/ftpfs.h: Provide a decl to the FTP file system opts table.
  • libmisc/Makefile.am: Add the mount command and supporting files.
  • libmisc/preinstall.am: Rebuilt.
  • libmisc/shell/cat_file.c, libmisc/shell/cmds.c, libmisc/shell/main_alias.c, libmisc/shell/main_cat.c, libmisc/shell/main_cd.c, libmisc/shell/main_chdir.c, libmisc/shell/main_chmod.c, libmisc/shell/main_chroot.c, libmisc/shell/main_cpuuse.c, libmisc/shell/main_date.c, libmisc/shell/main_dir.c, libmisc/shell/main_exit.c, libmisc/shell/main_help.c, libmisc/shell/main_id.c, libmisc/shell/main_logoff.c, libmisc/shell/main_ls.c, libmisc/shell/main_mallocdump.c, libmisc/shell/main_mdump.c, libmisc/shell/main_medit.c, libmisc/shell/main_mfill.c, libmisc/shell/main_mkdir.c, libmisc/shell/main_mmove.c, libmisc/shell/main_mwdump.c, libmisc/shell/main_pwd.c, libmisc/shell/main_rm.c, libmisc/shell/main_rmdir.c, libmisc/shell/main_stackuse.c, libmisc/shell/main_tty.c, libmisc/shell/main_umask.c, libmisc/shell/main_whoami.c, libmisc/shell/shell.c, libmisc/shell/shell_cmdset.c, libmisc/shell/shell_makeargs.c, libmisc/shell/str2int.c, libmisc/shell/write_file.c: Move all shell_* types, variables and functions to rtems_shell_* to avoid namespace clashes with applications. The is an RTEMS shell after all.
  • libmisc/shell/shell.h, libmisc/shell/internal.h, libmisc/shell/shellconfig.h: Move all shell_* types, variables and functions to rtems_shell_* to avoid namespace clashes with applications. Add the mount command supporting types.
  • libmisc/shell/main_mount.c, libmisc/shell/main_mount_ftp.c, libmisc/shell/main_mount_msdos.c, libmisc/shell/main_mount_nfs.c, libmisc/shell/main_mount_tftp.c: New.
  • Property mode set to 100644
File size: 1.2 KB
Line 
1/*
2 *  CHMOD Shell Command Implmentation
3 *
4 *  Author: Fernando RUIZ CASAS
5 *  Work: fernando.ruiz@ctv.es
6 *  Home: correo@fernando-ruiz.com
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 *
12 *  $Id$
13 */
14
15#ifdef HAVE_CONFIG_H
16#include "config.h"
17#endif
18
19#include <stdio.h>
20#include <unistd.h>
21#include <string.h>
22#include <errno.h>
23#include <sys/types.h>
24#include <sys/stat.h>
25
26#include <rtems.h>
27#include <rtems/monitor.h>
28#include <rtems/shell.h>
29#include "internal.h"
30
31int rtems_shell_main_chmod(int argc,char *argv[])
32{
33  int n;
34  mode_t mode;
35
36  if (argc > 2){
37    mode = rtems_shell_str2int(argv[1])&0777;
38    n = 2;
39    while (n<argc)
40      chmod(argv[n++], mode);
41  }
42  return 0;
43}
44
45rtems_shell_cmd_t rtems_Shell_CHMOD_Command = {
46  "chmod",                                      /* name */
47  "chmod 0777 n1 n2... # change filemode",      /* usage */
48  "files",                                      /* topic */
49  rtems_shell_main_chmod,                       /* command */
50  NULL,                                         /* alias */
51  NULL                                          /* next */
52};
Note: See TracBrowser for help on using the repository browser.