Tizen 2.0 Release
[external/tizen-coreutils.git] / src / c99-to-c89.diff
1 Index: src/remove.c
2 ===================================================================
3 RCS file: /fetish/cu/src/remove.c,v
4 retrieving revision 1.158
5 diff --git a/src/remove.c b/src/remove.c
6 index 4728bdd..7477da5 100644
7 --- a/src/remove.c
8 +++ b/src/remove.c
9 @@ -236,9 +236,10 @@ pop_dir (Dirstack_state *ds)
10  {
11    size_t n_lengths = obstack_object_size (&ds->len_stack) / sizeof (size_t);
12    size_t *length = obstack_base (&ds->len_stack);
13 +  size_t top_len;
14
15    assert (n_lengths > 0);
16 -  size_t top_len = length[n_lengths - 1];
17 +  top_len = length[n_lengths - 1];
18    assert (top_len >= 2);
19
20    /* Pop the specified length of file name.  */
21 @@ -370,10 +371,11 @@ AD_stack_top (Dirstack_state const *ds)
22  static void
23  AD_stack_pop (Dirstack_state *ds)
24  {
25 +  struct AD_ent *top;
26    assert (0 < AD_stack_height (ds));
27
28    /* operate on Active_dir.  pop and free top entry */
29 -  struct AD_ent *top = AD_stack_top (ds);
30 +  top = AD_stack_top (ds);
31    if (top->unremovable)
32      hash_free (top->unremovable);
33    obstack_blank (&ds->Active_dir, -(int) sizeof (struct AD_ent));
34 @@ -815,6 +817,7 @@ prompt (int fd_cwd, Dirstack_state const *ds, char const *filename,
35
36    if (write_protected || x->interactive == RMI_ALWAYS)
37      {
38 +      char const *quoted_name = quote (full_filename (filename));
39        if (write_protected <= 0
40           && cache_fstatat (fd_cwd, filename, sbuf, AT_SYMLINK_NOFOLLOW) != 0)
41         {
42 @@ -832,8 +835,6 @@ prompt (int fd_cwd, Dirstack_state const *ds, char const *filename,
43             write_protected = EISDIR;
44         }
45
46 -      char const *quoted_name = quote (full_filename (filename));
47 -
48        if (0 < write_protected)
49         {
50           error (0, write_protected, _("cannot remove %s"), quoted_name);
51 @@ -1487,6 +1488,7 @@ rm_1 (Dirstack_state *ds, char const *filename,
52        return RM_ERROR;
53      }
54
55 +  {
56    struct stat st;
57    cache_stat_init (&st);
58    cycle_check_init (&ds->cycle_check_state);
59 @@ -1509,6 +1511,7 @@ rm_1 (Dirstack_state *ds, char const *filename,
60    AD_push_initial (ds);
61    AD_INIT_OTHER_MEMBERS ();
62
63 +  {
64    enum RM_status status = remove_entry (AT_FDCWD, ds, filename, &st, x, NULL);
65    if (status == RM_NONEMPTY_DIR)
66      {
67 @@ -1525,6 +1528,8 @@ rm_1 (Dirstack_state *ds, char const *filename,
68
69    ds_clear (ds);
70    return status;
71 +  }
72 +  }
73  }
74
75  /* Remove all files and/or directories specified by N_FILES and FILE.
76 Index: src/rm.c
77 ===================================================================
78 RCS file: /fetish/cu/src/rm.c,v
79 retrieving revision 1.140
80 diff --git a/src/rm.c b/src/rm.c
81 index 364a21c..7a24014 100644
82 --- a/src/rm.c
83 +++ b/src/rm.c
84 @@ -355,6 +355,7 @@ main (int argc, char **argv)
85                quote ("/"));
86      }
87
88 +  {
89    size_t n_files = argc - optind;
90    char const *const *file = (char const *const *) argv + optind;
91
92 @@ -368,7 +369,10 @@ main (int argc, char **argv)
93        if (!yesno ())
94         exit (EXIT_SUCCESS);
95      }
96 +  {
97    enum RM_status status = rm (n_files, file, &x);
98    assert (VALID_STATUS (status));
99    exit (status == RM_ERROR ? EXIT_FAILURE : EXIT_SUCCESS);
100 +  }
101 +  }
102  }
103 Index: src/shred.c
104 ===================================================================
105 RCS file: /fetish/cu/src/shred.c,v
106 retrieving revision 1.130
107 diff -u -p -r1.130 shred.c
108 --- a/src/shred.c     3 Sep 2006 02:53:16 -0000       1.130
109 +++ b/src/shred.c     3 Oct 2006 13:48:24 -0000
110 @@ -464,7 +464,7 @@ dopass (int fd, char const *qname, off_t
111                      out.  Thus, it shouldn't give up on bad blocks.  This
112                      code works because lim is always a multiple of
113                      SECTOR_SIZE, except at the end.  */
114 -                 verify (sizeof r % SECTOR_SIZE == 0);
115 +                 { verify (sizeof r % SECTOR_SIZE == 0); }
116                   if (errnum == EIO && 0 <= size && (soff | SECTOR_MASK) < lim)
117                     {
118                       size_t soff1 = (soff | SECTOR_MASK) + 1;