xalloc_die ();
}
-#ifdef lint
-extern void
-dest_info_free (struct cp_options *x)
-{
- if (x->dest_info)
- hash_free (x->dest_info);
- x->dest_info = NULL;
-}
-#endif
-
/* Initialize the hash table implementing a set of F_triple entries
corresponding to source files listed on the command line. */
extern void
xalloc_die ();
}
-#ifdef lint
-extern void
-src_info_free (struct cp_options *x)
-{
- if (x->src_info)
- hash_free (x->src_info);
- x->src_info = NULL;
-}
-#endif
-
/* When effecting a move (e.g., for mv(1)), and given the name DST_NAME
aka DST_DIRFD+DST_RELNAME
of the destination and a corresponding stat buffer, DST_SB, return
return false;
}
}
-#ifdef lint
else
{
+#if defined lint && (defined __clang__ || defined __COVERITY__)
assert (x->move_mode);
memset (&src_sb, 0, sizeof src_sb);
- }
#endif
+ }
/* Detect the case in which the same source file appears more than
once on the command line and no backup option has been selected.
if (src_to_dest == NULL)
xalloc_die ();
}
-
-/* Reset the hash structure in the global variable 'htab' to
- contain no entries. */
-
-#ifdef lint
-extern void
-forget_all (void)
-{
- hash_free (src_to_dest);
-}
-#endif
void hash_init (void);
-void forget_all (void);
void forget_created (ino_t ino, dev_t dev);
char *remember_copied (char const *node, ino_t ino, dev_t dev)
_GL_ATTRIBUTE_NONNULL ();
free (dst_name);
}
-
-#ifdef lint
- dest_info_free (x);
- src_info_free (x);
-#endif
}
else /* !target_directory */
{
ok = do_copy (argc - optind, argv + optind,
target_directory, no_target_directory, &x);
-#ifdef lint
- forget_all ();
-#endif
-
- return ok ? EXIT_SUCCESS : EXIT_FAILURE;
+ main_exit (ok ? EXIT_SUCCESS : EXIT_FAILURE);
}
i == 0 && mkdir_and_install,
&target_dirfd))
exit_status = EXIT_FAILURE;
-#ifdef lint
- dest_info_free (&x);
-#endif
}
}
- return exit_status;
+ main_exit (exit_status);
}
ok &= do_link (file[i], destdir_fd, dest_base, dest, -1);
free (dest);
}
-
-#ifdef lint
- if (dest_set)
- hash_free (dest_set);
- dest_set = NULL;
-#endif
}
else
ok = do_link (file[0], AT_FDCWD, file[1], file[1], link_errno);
- return ok ? EXIT_SUCCESS : EXIT_FAILURE;
+ main_exit (ok ? EXIT_SUCCESS : EXIT_FAILURE);
}
ok &= do_move (source, dest, target_dirfd, dest_relname, &x);
free (dest);
}
-
-#ifdef lint
- dest_info_free (&x);
-#endif
}
else
{
ok = do_move (file[0], file[1], AT_FDCWD, file[1], &x);
}
- return ok ? EXIT_SUCCESS : EXIT_FAILURE;
+ main_exit (ok ? EXIT_SUCCESS : EXIT_FAILURE);
}