Merge cvs-1.11.2.1-20021201 -> 1.11.5 changes onto mainline
This commit is contained in:
parent
3a7972097e
commit
9de666118b
@ -108,7 +108,7 @@ allocate_buffer_datas ()
|
|||||||
#define ALLOC_COUNT (16)
|
#define ALLOC_COUNT (16)
|
||||||
|
|
||||||
alc = ((struct buffer_data *)
|
alc = ((struct buffer_data *)
|
||||||
malloc (ALLOC_COUNT * sizeof (struct buffer_data)));
|
xmalloc (ALLOC_COUNT * sizeof (struct buffer_data)));
|
||||||
space = (char *) valloc (ALLOC_COUNT * BUFFER_DATA_SIZE);
|
space = (char *) valloc (ALLOC_COUNT * BUFFER_DATA_SIZE);
|
||||||
if (alc == NULL || space == NULL)
|
if (alc == NULL || space == NULL)
|
||||||
return;
|
return;
|
||||||
@ -156,7 +156,7 @@ buf_empty_p (buf)
|
|||||||
#ifdef SERVER_FLOWCONTROL
|
#ifdef SERVER_FLOWCONTROL
|
||||||
/*
|
/*
|
||||||
* Count how much data is stored in the buffer..
|
* Count how much data is stored in the buffer..
|
||||||
* Note that each buffer is a malloc'ed chunk BUFFER_DATA_SIZE.
|
* Note that each buffer is a xmalloc'ed chunk BUFFER_DATA_SIZE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -796,7 +796,7 @@ buf_read_line (buf, line, lenp)
|
|||||||
char *p;
|
char *p;
|
||||||
struct buffer_data *nldata;
|
struct buffer_data *nldata;
|
||||||
|
|
||||||
p = malloc (len + 1);
|
p = xmalloc (len + 1);
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
return -2;
|
return -2;
|
||||||
*line = p;
|
*line = p;
|
||||||
@ -1235,7 +1235,7 @@ stdio_buffer_initialize (fp, child_pid, input, memory)
|
|||||||
int input;
|
int input;
|
||||||
void (*memory) PROTO((struct buffer *));
|
void (*memory) PROTO((struct buffer *));
|
||||||
{
|
{
|
||||||
struct stdio_buffer_closure *bc = malloc (sizeof (*bc));
|
struct stdio_buffer_closure *bc = xmalloc (sizeof (*bc));
|
||||||
|
|
||||||
bc->fp = fp;
|
bc->fp = fp;
|
||||||
bc->child_pid = child_pid;
|
bc->child_pid = child_pid;
|
||||||
@ -1679,7 +1679,7 @@ packetizing_buffer_input (closure, data, need, size, got)
|
|||||||
/* We didn't allocate enough space in the initialize
|
/* We didn't allocate enough space in the initialize
|
||||||
function. */
|
function. */
|
||||||
|
|
||||||
n = realloc (pb->holdbuf, count + 2);
|
n = xrealloc (pb->holdbuf, count + 2);
|
||||||
if (n == NULL)
|
if (n == NULL)
|
||||||
{
|
{
|
||||||
(*pb->buf->memory_error) (pb->buf);
|
(*pb->buf->memory_error) (pb->buf);
|
||||||
@ -1741,7 +1741,7 @@ packetizing_buffer_input (closure, data, need, size, got)
|
|||||||
outbuf = stackoutbuf;
|
outbuf = stackoutbuf;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
outbuf = malloc (count);
|
outbuf = xmalloc (count);
|
||||||
if (outbuf == NULL)
|
if (outbuf == NULL)
|
||||||
{
|
{
|
||||||
(*pb->buf->memory_error) (pb->buf);
|
(*pb->buf->memory_error) (pb->buf);
|
||||||
@ -1813,7 +1813,7 @@ packetizing_buffer_output (closure, data, have, wrote)
|
|||||||
|
|
||||||
if (have > BUFFER_DATA_SIZE)
|
if (have > BUFFER_DATA_SIZE)
|
||||||
{
|
{
|
||||||
/* It would be easy to malloc a buffer, but I don't think this
|
/* It would be easy to xmalloc a buffer, but I don't think this
|
||||||
case can ever arise. */
|
case can ever arise. */
|
||||||
abort ();
|
abort ();
|
||||||
}
|
}
|
||||||
|
@ -2179,7 +2179,7 @@ update_entries (data_arg, ent_list, short_pathname, filename)
|
|||||||
* date. Create a dummy timestamp which will never compare
|
* date. Create a dummy timestamp which will never compare
|
||||||
* equal to the timestamp of the file.
|
* equal to the timestamp of the file.
|
||||||
*/
|
*/
|
||||||
if (vn[0] == '\0' || vn[0] == '0' || vn[0] == '-')
|
if (vn[0] == '\0' || strcmp (vn, "0") == 0 || vn[0] == '-')
|
||||||
local_timestamp = "dummy timestamp";
|
local_timestamp = "dummy timestamp";
|
||||||
else if (local_timestamp == NULL)
|
else if (local_timestamp == NULL)
|
||||||
{
|
{
|
||||||
@ -3005,7 +3005,7 @@ send_a_repository (dir, repository, update_dir)
|
|||||||
&& (strcmp (repository + repository_len - update_dir_len,
|
&& (strcmp (repository + repository_len - update_dir_len,
|
||||||
update_dir) == 0)
|
update_dir) == 0)
|
||||||
/* TOPLEVEL_REPOS shouldn't be above current_parsed_root->directory */
|
/* TOPLEVEL_REPOS shouldn't be above current_parsed_root->directory */
|
||||||
&& ((repository_len - update_dir_len)
|
&& ((size_t)(repository_len - update_dir_len)
|
||||||
> strlen (current_parsed_root->directory)))
|
> strlen (current_parsed_root->directory)))
|
||||||
{
|
{
|
||||||
/* The repository name contains UPDATE_DIR. Set
|
/* The repository name contains UPDATE_DIR. Set
|
||||||
@ -5636,7 +5636,7 @@ send_files (argc, argv, local, aflag, flags)
|
|||||||
err = start_recursion
|
err = start_recursion
|
||||||
(send_fileproc, send_filesdoneproc,
|
(send_fileproc, send_filesdoneproc,
|
||||||
send_dirent_proc, send_dirleave_proc, (void *) &args,
|
send_dirent_proc, send_dirleave_proc, (void *) &args,
|
||||||
argc, argv, local, W_LOCAL, aflag, LOCK_NONE, (char *)NULL, 0);
|
argc, argv, local, W_LOCAL, aflag, CVS_LOCK_NONE, (char *)NULL, 0);
|
||||||
if (err)
|
if (err)
|
||||||
error_exit ();
|
error_exit ();
|
||||||
if (toplevel_repos == NULL)
|
if (toplevel_repos == NULL)
|
||||||
|
@ -249,26 +249,7 @@ find_fileproc (callerdat, finfo)
|
|||||||
xfinfo.rcs = NULL;
|
xfinfo.rcs = NULL;
|
||||||
|
|
||||||
vers = Version_TS (&xfinfo, NULL, saved_tag, NULL, 0, 0);
|
vers = Version_TS (&xfinfo, NULL, saved_tag, NULL, 0, 0);
|
||||||
if (vers->ts_user == NULL
|
if (vers->vn_user == NULL)
|
||||||
&& vers->vn_user != NULL
|
|
||||||
&& (vers->vn_user[0] == '0' || vers->vn_user[0] == '-'))
|
|
||||||
{
|
|
||||||
if ( vers->vn_user[0] == '0')
|
|
||||||
{
|
|
||||||
/* This happens when one has `cvs add'ed a file, but it no
|
|
||||||
longer exists in the working directory at commit time. */
|
|
||||||
status = T_ADDED;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* FIXME: If vn_user is starts with "-" but ts_user is
|
|
||||||
non-NULL, what classify_file does is print "%s should be
|
|
||||||
removed and is still there". I'm not sure what it does
|
|
||||||
then. We probably should do the same. */
|
|
||||||
status = T_REMOVED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (vers->vn_user == NULL)
|
|
||||||
{
|
{
|
||||||
if (vers->ts_user == NULL)
|
if (vers->ts_user == NULL)
|
||||||
error (0, 0, "nothing known about `%s'", finfo->fullname);
|
error (0, 0, "nothing known about `%s'", finfo->fullname);
|
||||||
@ -278,16 +259,28 @@ find_fileproc (callerdat, finfo)
|
|||||||
freevers_ts (&vers);
|
freevers_ts (&vers);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else if (vers->ts_user != NULL
|
if (vers->ts_user == NULL)
|
||||||
&& vers->vn_user != NULL
|
{
|
||||||
&& vers->vn_user[0] == '0')
|
if (strcmp (vers->vn_user, "0") == 0)
|
||||||
/* FIXME: If vn_user is "0" but ts_user is NULL, what classify_file
|
/* This happens when one has `cvs add'ed a file, but it no
|
||||||
does is print "new-born %s has disappeared" and removes the entry.
|
longer exists in the working directory at commit time.
|
||||||
We probably should do the same. No! Not here. Otherwise, a commit
|
FIXME: What classify_file does in this case is print
|
||||||
would succeed in some cases when it should fail. See above. */
|
"new-born %s has disappeared" and removes the entry.
|
||||||
|
We probably should do the same. */
|
||||||
|
status = T_ADDED;
|
||||||
|
else if (vers->vn_user[0] == '-')
|
||||||
|
status = T_REMOVED;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* FIXME: What classify_file does in this case is print
|
||||||
|
"%s was lost". We probably should do the same. */
|
||||||
|
freevers_ts (&vers);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (strcmp (vers->vn_user, "0") == 0)
|
||||||
status = T_ADDED;
|
status = T_ADDED;
|
||||||
else if (vers->ts_user != NULL
|
else if (vers->ts_rcs != NULL
|
||||||
&& vers->ts_rcs != NULL
|
|
||||||
&& (args->force || strcmp (vers->ts_user, vers->ts_rcs) != 0))
|
&& (args->force || strcmp (vers->ts_user, vers->ts_rcs) != 0))
|
||||||
/* If we are forcing commits, pretend that the file is
|
/* If we are forcing commits, pretend that the file is
|
||||||
modified. */
|
modified. */
|
||||||
@ -428,10 +421,12 @@ commit (argc, argv)
|
|||||||
/* numeric specified revision means we ignore sticky tags... */
|
/* numeric specified revision means we ignore sticky tags... */
|
||||||
if (saved_tag && isdigit ((unsigned char) *saved_tag))
|
if (saved_tag && isdigit ((unsigned char) *saved_tag))
|
||||||
{
|
{
|
||||||
|
char *p = saved_tag + strlen (saved_tag);
|
||||||
aflag = 1;
|
aflag = 1;
|
||||||
/* strip trailing dots */
|
/* strip trailing dots and leading zeros */
|
||||||
while (saved_tag[strlen (saved_tag) - 1] == '.')
|
while (*--p == '.') ;
|
||||||
saved_tag[strlen (saved_tag) - 1] = '\0';
|
p[1] = '\0';
|
||||||
|
while (*saved_tag == '0') ++saved_tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* some checks related to the "-F logfile" option */
|
/* some checks related to the "-F logfile" option */
|
||||||
@ -467,7 +462,7 @@ commit (argc, argv)
|
|||||||
err = start_recursion (find_fileproc, find_filesdoneproc,
|
err = start_recursion (find_fileproc, find_filesdoneproc,
|
||||||
find_dirent_proc, (DIRLEAVEPROC) NULL,
|
find_dirent_proc, (DIRLEAVEPROC) NULL,
|
||||||
(void *)&find_args,
|
(void *)&find_args,
|
||||||
argc, argv, local, W_LOCAL, 0, LOCK_NONE,
|
argc, argv, local, W_LOCAL, 0, CVS_LOCK_NONE,
|
||||||
(char *)NULL, 0);
|
(char *)NULL, 0);
|
||||||
if (err)
|
if (err)
|
||||||
error (1, 0, "correct above errors first!");
|
error (1, 0, "correct above errors first!");
|
||||||
@ -648,7 +643,7 @@ commit (argc, argv)
|
|||||||
*/
|
*/
|
||||||
err = start_recursion (check_fileproc, check_filesdoneproc,
|
err = start_recursion (check_fileproc, check_filesdoneproc,
|
||||||
check_direntproc, (DIRLEAVEPROC) NULL, NULL, argc,
|
check_direntproc, (DIRLEAVEPROC) NULL, NULL, argc,
|
||||||
argv, local, W_LOCAL, aflag, LOCK_NONE,
|
argv, local, W_LOCAL, aflag, CVS_LOCK_NONE,
|
||||||
(char *) NULL, 1);
|
(char *) NULL, 1);
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
@ -663,7 +658,7 @@ commit (argc, argv)
|
|||||||
if (noexec == 0)
|
if (noexec == 0)
|
||||||
err = start_recursion (commit_fileproc, commit_filesdoneproc,
|
err = start_recursion (commit_fileproc, commit_filesdoneproc,
|
||||||
commit_direntproc, commit_dirleaveproc, NULL,
|
commit_direntproc, commit_dirleaveproc, NULL,
|
||||||
argc, argv, local, W_LOCAL, aflag, LOCK_NONE,
|
argc, argv, local, W_LOCAL, aflag, CVS_LOCK_NONE,
|
||||||
(char *) NULL, 1);
|
(char *) NULL, 1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -16,9 +16,6 @@
|
|||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
# include <config.h> /* this is stuff found via autoconf */
|
# include <config.h> /* this is stuff found via autoconf */
|
||||||
#endif /* CONFIG_H */
|
#endif /* CONFIG_H */
|
||||||
#include "options.h" /* these are some larger questions which
|
|
||||||
can't easily be automatically checked
|
|
||||||
for */
|
|
||||||
|
|
||||||
/* Changed from if __STDC__ to ifdef __STDC__ because of Sun's acc compiler */
|
/* Changed from if __STDC__ to ifdef __STDC__ because of Sun's acc compiler */
|
||||||
|
|
||||||
@ -270,12 +267,10 @@ extern int errno;
|
|||||||
#define CVSREADONLYFS_ENV "CVSREADONLYFS" /* repository is read-only */
|
#define CVSREADONLYFS_ENV "CVSREADONLYFS" /* repository is read-only */
|
||||||
|
|
||||||
#define TMPDIR_ENV "TMPDIR" /* Temporary directory */
|
#define TMPDIR_ENV "TMPDIR" /* Temporary directory */
|
||||||
/* #define TMPDIR_DFLT Set by options.h */
|
|
||||||
|
|
||||||
#define EDITOR1_ENV "CVSEDITOR" /* which editor to use */
|
#define EDITOR1_ENV "CVSEDITOR" /* which editor to use */
|
||||||
#define EDITOR2_ENV "VISUAL" /* which editor to use */
|
#define EDITOR2_ENV "VISUAL" /* which editor to use */
|
||||||
#define EDITOR3_ENV "EDITOR" /* which editor to use */
|
#define EDITOR3_ENV "EDITOR" /* which editor to use */
|
||||||
/* #define EDITOR_DFLT Set by options.h */
|
|
||||||
|
|
||||||
#define CVSROOT_ENV "CVSROOT" /* source directory root */
|
#define CVSROOT_ENV "CVSROOT" /* source directory root */
|
||||||
#define CVSROOT_DFLT NULL /* No dflt; must set for checkout */
|
#define CVSROOT_DFLT NULL /* No dflt; must set for checkout */
|
||||||
@ -284,7 +279,6 @@ extern int errno;
|
|||||||
#define WRAPPER_ENV "CVSWRAPPERS" /* name of the wrapper file */
|
#define WRAPPER_ENV "CVSWRAPPERS" /* name of the wrapper file */
|
||||||
|
|
||||||
#define CVSUMASK_ENV "CVSUMASK" /* Effective umask for repository */
|
#define CVSUMASK_ENV "CVSUMASK" /* Effective umask for repository */
|
||||||
/* #define CVSUMASK_DFLT Set by options.h */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the beginning of the Repository matches the following string, strip it
|
* If the beginning of the Repository matches the following string, strip it
|
||||||
@ -369,9 +363,9 @@ typedef enum direnter_type Dtype;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Recursion processor lock types */
|
/* Recursion processor lock types */
|
||||||
#define LOCK_NONE 0
|
#define CVS_LOCK_NONE 0
|
||||||
#define LOCK_READ 1
|
#define CVS_LOCK_READ 1
|
||||||
#define LOCK_WRITE 2
|
#define CVS_LOCK_WRITE 2
|
||||||
|
|
||||||
extern char *program_name, *program_path, *command_name;
|
extern char *program_name, *program_path, *command_name;
|
||||||
extern char *Tmpdir, *Editor;
|
extern char *Tmpdir, *Editor;
|
||||||
|
@ -450,7 +450,7 @@ diff (argc, argv)
|
|||||||
/* start the recursion processor */
|
/* start the recursion processor */
|
||||||
err = start_recursion (diff_fileproc, diff_filesdoneproc, diff_dirproc,
|
err = start_recursion (diff_fileproc, diff_filesdoneproc, diff_dirproc,
|
||||||
diff_dirleaveproc, NULL, argc, argv, local,
|
diff_dirleaveproc, NULL, argc, argv, local,
|
||||||
which, 0, LOCK_READ, (char *) NULL, 1);
|
which, 0, CVS_LOCK_READ, (char *) NULL, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* clean up */
|
/* clean up */
|
||||||
|
@ -932,7 +932,7 @@ lock_tree_for_write (argc, argv, local, which, aflag)
|
|||||||
lock_tree_list = getlist ();
|
lock_tree_list = getlist ();
|
||||||
err = start_recursion ((FILEPROC) NULL, lock_filesdoneproc,
|
err = start_recursion ((FILEPROC) NULL, lock_filesdoneproc,
|
||||||
(DIRENTPROC) NULL, (DIRLEAVEPROC) NULL, NULL, argc,
|
(DIRENTPROC) NULL, (DIRLEAVEPROC) NULL, NULL, argc,
|
||||||
argv, local, which, aflag, LOCK_NONE,
|
argv, local, which, aflag, CVS_LOCK_NONE,
|
||||||
(char *) NULL, 0);
|
(char *) NULL, 0);
|
||||||
sortlist (lock_tree_list, fsortcmp);
|
sortlist (lock_tree_list, fsortcmp);
|
||||||
if (Writer_Lock (lock_tree_list) != 0)
|
if (Writer_Lock (lock_tree_list) != 0)
|
||||||
|
@ -7570,7 +7570,7 @@ unable to parse %s; `author' not in the expected place", rcsfile);
|
|||||||
unable to parse %s; `state' not in the expected place", rcsfile);
|
unable to parse %s; `state' not in the expected place", rcsfile);
|
||||||
vnode->state = rcsbuf_valcopy (rcsbuf, value, 0, (size_t *) NULL);
|
vnode->state = rcsbuf_valcopy (rcsbuf, value, 0, (size_t *) NULL);
|
||||||
/* The value is optional, according to rcsfile(5). */
|
/* The value is optional, according to rcsfile(5). */
|
||||||
if (value != NULL && STREQ (value, "dead"))
|
if (value != NULL && STREQ (value, RCSDEAD))
|
||||||
{
|
{
|
||||||
vnode->dead = 1;
|
vnode->dead = 1;
|
||||||
}
|
}
|
||||||
@ -7656,7 +7656,7 @@ unable to parse %s; `state' not in the expected place", rcsfile);
|
|||||||
vnode->dead = 1;
|
vnode->dead = 1;
|
||||||
if (vnode->state != NULL)
|
if (vnode->state != NULL)
|
||||||
free (vnode->state);
|
free (vnode->state);
|
||||||
vnode->state = xstrdup ("dead");
|
vnode->state = xstrdup (RCSDEAD);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/* if we have a new revision number, we're done with this delta */
|
/* if we have a new revision number, we're done with this delta */
|
||||||
|
@ -512,7 +512,7 @@ do_recursion (frame)
|
|||||||
if (frame->flags == R_SKIP_ALL)
|
if (frame->flags == R_SKIP_ALL)
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
locktype = noexec ? LOCK_NONE : frame->locktype;
|
locktype = noexec ? CVS_LOCK_NONE : frame->locktype;
|
||||||
|
|
||||||
/* The fact that locks are not active here is what makes us fail to have
|
/* The fact that locks are not active here is what makes us fail to have
|
||||||
the
|
the
|
||||||
@ -552,7 +552,7 @@ do_recursion (frame)
|
|||||||
* generating data, to give the buffers a chance to drain to the
|
* generating data, to give the buffers a chance to drain to the
|
||||||
* remote client. We should not have locks active at this point,
|
* remote client. We should not have locks active at this point,
|
||||||
* but if there are writelocks around, we cannot pause here. */
|
* but if there are writelocks around, we cannot pause here. */
|
||||||
if (server_active && locktype != LOCK_NONE)
|
if (server_active && locktype != CVS_LOCK_NONE)
|
||||||
server_pause_check();
|
server_pause_check();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -707,12 +707,12 @@ do_recursion (frame)
|
|||||||
/* read lock it if necessary */
|
/* read lock it if necessary */
|
||||||
if (repository)
|
if (repository)
|
||||||
{
|
{
|
||||||
if (locktype == LOCK_READ)
|
if (locktype == CVS_LOCK_READ)
|
||||||
{
|
{
|
||||||
if (Reader_Lock (repository) != 0)
|
if (Reader_Lock (repository) != 0)
|
||||||
error (1, 0, "read lock failed - giving up");
|
error (1, 0, "read lock failed - giving up");
|
||||||
}
|
}
|
||||||
else if (locktype == LOCK_WRITE)
|
else if (locktype == CVS_LOCK_WRITE)
|
||||||
lock_dir_for_write (repository);
|
lock_dir_for_write (repository);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -737,7 +737,7 @@ do_recursion (frame)
|
|||||||
err += walklist (filelist, do_file_proc, &frfile);
|
err += walklist (filelist, do_file_proc, &frfile);
|
||||||
|
|
||||||
/* unlock it */
|
/* unlock it */
|
||||||
if (locktype != LOCK_NONE)
|
if (locktype != CVS_LOCK_NONE)
|
||||||
Lock_Cleanup ();
|
Lock_Cleanup ();
|
||||||
|
|
||||||
/* clean up */
|
/* clean up */
|
||||||
|
@ -353,17 +353,17 @@ create_adm_p (base_dir, dir)
|
|||||||
return 0; /* nothing to do */
|
return 0; /* nothing to do */
|
||||||
|
|
||||||
/* Allocate some space for our directory-munging string. */
|
/* Allocate some space for our directory-munging string. */
|
||||||
p = malloc (strlen (dir) + 1);
|
p = xmalloc (strlen (dir) + 1);
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
|
|
||||||
dir_where_cvsadm_lives = malloc (strlen (base_dir) + strlen (dir) + 100);
|
dir_where_cvsadm_lives = xmalloc (strlen (base_dir) + strlen (dir) + 100);
|
||||||
if (dir_where_cvsadm_lives == NULL)
|
if (dir_where_cvsadm_lives == NULL)
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
|
|
||||||
/* Allocate some space for the temporary string in which we will
|
/* Allocate some space for the temporary string in which we will
|
||||||
construct filenames. */
|
construct filenames. */
|
||||||
tmp = malloc (strlen (base_dir) + strlen (dir) + 100);
|
tmp = xmalloc (strlen (base_dir) + strlen (dir) + 100);
|
||||||
if (tmp == NULL)
|
if (tmp == NULL)
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
|
|
||||||
@ -403,7 +403,7 @@ create_adm_p (base_dir, dir)
|
|||||||
differently. */
|
differently. */
|
||||||
|
|
||||||
char *empty;
|
char *empty;
|
||||||
empty = malloc (strlen (current_parsed_root->directory)
|
empty = xmalloc (strlen (current_parsed_root->directory)
|
||||||
+ sizeof (CVSROOTADM)
|
+ sizeof (CVSROOTADM)
|
||||||
+ sizeof (CVSNULLREPOS)
|
+ sizeof (CVSNULLREPOS)
|
||||||
+ 3);
|
+ 3);
|
||||||
@ -521,7 +521,7 @@ mkdir_p (dir)
|
|||||||
char *dir;
|
char *dir;
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
char *q = malloc (strlen (dir) + 1);
|
char *q = xmalloc (strlen (dir) + 1);
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
if (q == NULL)
|
if (q == NULL)
|
||||||
@ -648,7 +648,7 @@ alloc_pending (size)
|
|||||||
this case. But we might as well handle it if they don't, I
|
this case. But we might as well handle it if they don't, I
|
||||||
guess. */
|
guess. */
|
||||||
return 0;
|
return 0;
|
||||||
pending_error_text = malloc (size);
|
pending_error_text = xmalloc (size);
|
||||||
if (pending_error_text == NULL)
|
if (pending_error_text == NULL)
|
||||||
{
|
{
|
||||||
pending_error = ENOMEM;
|
pending_error = ENOMEM;
|
||||||
@ -779,7 +779,7 @@ E Protocol error: Root says \"%s\" but pserver says \"%s\"",
|
|||||||
/* Now is a good time to read CVSROOT/options too. */
|
/* Now is a good time to read CVSROOT/options too. */
|
||||||
parseopts(current_parsed_root->directory);
|
parseopts(current_parsed_root->directory);
|
||||||
|
|
||||||
path = malloc (strlen (current_parsed_root->directory)
|
path = xmalloc (strlen (current_parsed_root->directory)
|
||||||
+ sizeof (CVSROOTADM)
|
+ sizeof (CVSROOTADM)
|
||||||
+ 2);
|
+ 2);
|
||||||
if (path == NULL)
|
if (path == NULL)
|
||||||
@ -798,7 +798,7 @@ E Protocol error: Root says \"%s\" but pserver says \"%s\"",
|
|||||||
free (path);
|
free (path);
|
||||||
|
|
||||||
#ifdef HAVE_PUTENV
|
#ifdef HAVE_PUTENV
|
||||||
env = malloc (strlen (CVSROOT_ENV) + strlen (current_parsed_root->directory) + 2);
|
env = xmalloc (strlen (CVSROOT_ENV) + strlen (current_parsed_root->directory) + 2);
|
||||||
if (env == NULL)
|
if (env == NULL)
|
||||||
{
|
{
|
||||||
pending_error = ENOMEM;
|
pending_error = ENOMEM;
|
||||||
@ -929,7 +929,7 @@ serve_max_dotdot (arg)
|
|||||||
|
|
||||||
if (lim < 0)
|
if (lim < 0)
|
||||||
return;
|
return;
|
||||||
p = malloc (strlen (server_temp_dir) + 2 * lim + 10);
|
p = xmalloc (strlen (server_temp_dir) + 2 * lim + 10);
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
{
|
{
|
||||||
pending_error = ENOMEM;
|
pending_error = ENOMEM;
|
||||||
@ -978,9 +978,6 @@ dirswitch (dir, repos)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dir_name != NULL)
|
|
||||||
free (dir_name);
|
|
||||||
|
|
||||||
dir_len = strlen (dir);
|
dir_len = strlen (dir);
|
||||||
|
|
||||||
/* Check for a trailing '/'. This is not ISDIRSEP because \ in the
|
/* Check for a trailing '/'. This is not ISDIRSEP because \ in the
|
||||||
@ -996,7 +993,10 @@ dirswitch (dir, repos)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
dir_name = malloc (strlen (server_temp_dir) + dir_len + 40);
|
if (dir_name != NULL)
|
||||||
|
free (dir_name);
|
||||||
|
|
||||||
|
dir_name = xmalloc (strlen (server_temp_dir) + dir_len + 40);
|
||||||
if (dir_name == NULL)
|
if (dir_name == NULL)
|
||||||
{
|
{
|
||||||
pending_error = ENOMEM;
|
pending_error = ENOMEM;
|
||||||
@ -1168,7 +1168,7 @@ serve_directory (arg)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pending_error_text = malloc (80 + strlen (arg));
|
pending_error_text = xmalloc (80 + strlen (arg));
|
||||||
if (pending_error_text == NULL)
|
if (pending_error_text == NULL)
|
||||||
{
|
{
|
||||||
pending_error = ENOMEM;
|
pending_error = ENOMEM;
|
||||||
@ -1275,7 +1275,7 @@ receive_partial_file (size, file)
|
|||||||
pending_error = ENOMEM;
|
pending_error = ENOMEM;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pending_error_text = malloc (80);
|
pending_error_text = xmalloc (80);
|
||||||
if (pending_error_text == NULL)
|
if (pending_error_text == NULL)
|
||||||
pending_error = ENOMEM;
|
pending_error = ENOMEM;
|
||||||
else if (status == -1)
|
else if (status == -1)
|
||||||
@ -1362,7 +1362,7 @@ receive_file (size, file, gzipped)
|
|||||||
char *filebuf;
|
char *filebuf;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
filebuf = malloc (size);
|
filebuf = xmalloc (size);
|
||||||
p = filebuf;
|
p = filebuf;
|
||||||
/* If NULL, we still want to read the data and discard it. */
|
/* If NULL, we still want to read the data and discard it. */
|
||||||
|
|
||||||
@ -1378,7 +1378,7 @@ receive_file (size, file, gzipped)
|
|||||||
pending_error = ENOMEM;
|
pending_error = ENOMEM;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pending_error_text = malloc (80);
|
pending_error_text = xmalloc (80);
|
||||||
if (pending_error_text == NULL)
|
if (pending_error_text == NULL)
|
||||||
pending_error = ENOMEM;
|
pending_error = ENOMEM;
|
||||||
else if (status == -1)
|
else if (status == -1)
|
||||||
@ -1424,7 +1424,7 @@ receive_file (size, file, gzipped)
|
|||||||
|
|
||||||
if (pending_error_text)
|
if (pending_error_text)
|
||||||
{
|
{
|
||||||
char *p = realloc (pending_error_text,
|
char *p = xrealloc (pending_error_text,
|
||||||
strlen (pending_error_text) + strlen (arg) + 30);
|
strlen (pending_error_text) + strlen (arg) + 30);
|
||||||
if (p)
|
if (p)
|
||||||
{
|
{
|
||||||
@ -1481,7 +1481,7 @@ serve_modified (arg)
|
|||||||
pending_error = ENOMEM;
|
pending_error = ENOMEM;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pending_error_text = malloc (80 + strlen (arg));
|
pending_error_text = xmalloc (80 + strlen (arg));
|
||||||
if (pending_error_text == NULL)
|
if (pending_error_text == NULL)
|
||||||
pending_error = ENOMEM;
|
pending_error = ENOMEM;
|
||||||
else
|
else
|
||||||
@ -1507,7 +1507,7 @@ serve_modified (arg)
|
|||||||
pending_error = ENOMEM;
|
pending_error = ENOMEM;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pending_error_text = malloc (80 + strlen (arg));
|
pending_error_text = xmalloc (80 + strlen (arg));
|
||||||
if (pending_error_text == NULL)
|
if (pending_error_text == NULL)
|
||||||
pending_error = ENOMEM;
|
pending_error = ENOMEM;
|
||||||
else
|
else
|
||||||
@ -1721,13 +1721,13 @@ serve_is_modified (arg)
|
|||||||
{
|
{
|
||||||
/* We got Is-modified but no Entry. Add a dummy entry.
|
/* We got Is-modified but no Entry. Add a dummy entry.
|
||||||
The "D" timestamp is what makes it a dummy. */
|
The "D" timestamp is what makes it a dummy. */
|
||||||
p = (struct an_entry *) malloc (sizeof (struct an_entry));
|
p = (struct an_entry *) xmalloc (sizeof (struct an_entry));
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
{
|
{
|
||||||
pending_error = ENOMEM;
|
pending_error = ENOMEM;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
p->entry = malloc (strlen (arg) + 80);
|
p->entry = xmalloc (strlen (arg) + 80);
|
||||||
if (p->entry == NULL)
|
if (p->entry == NULL)
|
||||||
{
|
{
|
||||||
pending_error = ENOMEM;
|
pending_error = ENOMEM;
|
||||||
@ -1758,14 +1758,14 @@ serve_entry (arg)
|
|||||||
struct an_entry *p;
|
struct an_entry *p;
|
||||||
char *cp;
|
char *cp;
|
||||||
if (error_pending()) return;
|
if (error_pending()) return;
|
||||||
p = (struct an_entry *) malloc (sizeof (struct an_entry));
|
p = (struct an_entry *) xmalloc (sizeof (struct an_entry));
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
{
|
{
|
||||||
pending_error = ENOMEM;
|
pending_error = ENOMEM;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* Leave space for serve_unchanged to write '=' if it wants. */
|
/* Leave space for serve_unchanged to write '=' if it wants. */
|
||||||
cp = malloc (strlen (arg) + 2);
|
cp = xmalloc (strlen (arg) + 2);
|
||||||
if (cp == NULL)
|
if (cp == NULL)
|
||||||
{
|
{
|
||||||
pending_error = ENOMEM;
|
pending_error = ENOMEM;
|
||||||
@ -1807,7 +1807,7 @@ serve_kopt (arg)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
kopt = malloc (strlen (arg) + 1);
|
kopt = xmalloc (strlen (arg) + 1);
|
||||||
if (kopt == NULL)
|
if (kopt == NULL)
|
||||||
{
|
{
|
||||||
pending_error = ENOMEM;
|
pending_error = ENOMEM;
|
||||||
@ -1901,13 +1901,13 @@ server_write_entries ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct notify_note {
|
struct notify_note {
|
||||||
/* Directory in which this notification happens. malloc'd*/
|
/* Directory in which this notification happens. xmalloc'd*/
|
||||||
char *dir;
|
char *dir;
|
||||||
|
|
||||||
/* malloc'd. */
|
/* xmalloc'd. */
|
||||||
char *filename;
|
char *filename;
|
||||||
|
|
||||||
/* The following three all in one malloc'd block, pointed to by TYPE.
|
/* The following three all in one xmalloc'd block, pointed to by TYPE.
|
||||||
Each '\0' terminated. */
|
Each '\0' terminated. */
|
||||||
/* "E" or "U". */
|
/* "E" or "U". */
|
||||||
char *type;
|
char *type;
|
||||||
@ -1940,14 +1940,14 @@ serve_notify (arg)
|
|||||||
if (dir_name == NULL)
|
if (dir_name == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
new = (struct notify_note *) malloc (sizeof (struct notify_note));
|
new = (struct notify_note *) xmalloc (sizeof (struct notify_note));
|
||||||
if (new == NULL)
|
if (new == NULL)
|
||||||
{
|
{
|
||||||
pending_error = ENOMEM;
|
pending_error = ENOMEM;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
new->dir = malloc (strlen (dir_name) + 1);
|
new->dir = xmalloc (strlen (dir_name) + 1);
|
||||||
new->filename = malloc (strlen (arg) + 1);
|
new->filename = xmalloc (strlen (arg) + 1);
|
||||||
if (new->dir == NULL || new->filename == NULL)
|
if (new->dir == NULL || new->filename == NULL)
|
||||||
{
|
{
|
||||||
pending_error = ENOMEM;
|
pending_error = ENOMEM;
|
||||||
@ -1966,7 +1966,7 @@ serve_notify (arg)
|
|||||||
pending_error = ENOMEM;
|
pending_error = ENOMEM;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pending_error_text = malloc (80 + strlen (arg));
|
pending_error_text = xmalloc (80 + strlen (arg));
|
||||||
if (pending_error_text == NULL)
|
if (pending_error_text == NULL)
|
||||||
pending_error = ENOMEM;
|
pending_error = ENOMEM;
|
||||||
else
|
else
|
||||||
@ -2126,7 +2126,7 @@ serve_argument (arg)
|
|||||||
{
|
{
|
||||||
argument_vector_size *= 2;
|
argument_vector_size *= 2;
|
||||||
argument_vector =
|
argument_vector =
|
||||||
(char **) realloc ((char *)argument_vector,
|
(char **) xrealloc ((char *)argument_vector,
|
||||||
argument_vector_size * sizeof (char *));
|
argument_vector_size * sizeof (char *));
|
||||||
if (argument_vector == NULL)
|
if (argument_vector == NULL)
|
||||||
{
|
{
|
||||||
@ -2134,7 +2134,7 @@ serve_argument (arg)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p = malloc (strlen (arg) + 1);
|
p = xmalloc (strlen (arg) + 1);
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
{
|
{
|
||||||
pending_error = ENOMEM;
|
pending_error = ENOMEM;
|
||||||
@ -2153,7 +2153,7 @@ serve_argumentx (arg)
|
|||||||
if (error_pending()) return;
|
if (error_pending()) return;
|
||||||
|
|
||||||
p = argument_vector[argument_count - 1];
|
p = argument_vector[argument_count - 1];
|
||||||
p = realloc (p, strlen (p) + 1 + strlen (arg) + 1);
|
p = xrealloc (p, strlen (p) + 1 + strlen (arg) + 1);
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
{
|
{
|
||||||
pending_error = ENOMEM;
|
pending_error = ENOMEM;
|
||||||
@ -3864,7 +3864,7 @@ serve_co (arg)
|
|||||||
* The client has not sent a "Repository" line. Check out
|
* The client has not sent a "Repository" line. Check out
|
||||||
* into a pristine directory.
|
* into a pristine directory.
|
||||||
*/
|
*/
|
||||||
tempdir = malloc (strlen (server_temp_dir) + 80);
|
tempdir = xmalloc (strlen (server_temp_dir) + 80);
|
||||||
if (tempdir == NULL)
|
if (tempdir == NULL)
|
||||||
{
|
{
|
||||||
buf_output0 (buf_to_net, "E Out of memory\n");
|
buf_output0 (buf_to_net, "E Out of memory\n");
|
||||||
@ -5067,7 +5067,7 @@ server (argc, argv)
|
|||||||
int status;
|
int status;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
server_temp_dir = malloc (strlen (Tmpdir) + 80);
|
server_temp_dir = xmalloc (strlen (Tmpdir) + 80);
|
||||||
if (server_temp_dir == NULL)
|
if (server_temp_dir == NULL)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
@ -500,7 +500,7 @@ do_update (argc, argv, xoptions, xtag, xdate, xforce, local, xbuild, xaflag,
|
|||||||
follows it; someone should make sure that I did it right. */
|
follows it; someone should make sure that I did it right. */
|
||||||
err = start_recursion (get_linkinfo_proc, (FILESDONEPROC) NULL,
|
err = start_recursion (get_linkinfo_proc, (FILESDONEPROC) NULL,
|
||||||
(DIRENTPROC) NULL, (DIRLEAVEPROC) NULL, NULL,
|
(DIRENTPROC) NULL, (DIRLEAVEPROC) NULL, NULL,
|
||||||
argc, argv, local, which, aflag, LOCK_READ,
|
argc, argv, local, which, aflag, CVS_LOCK_READ,
|
||||||
preload_update_dir, 1);
|
preload_update_dir, 1);
|
||||||
if (err)
|
if (err)
|
||||||
return (err);
|
return (err);
|
||||||
@ -516,7 +516,7 @@ do_update (argc, argv, xoptions, xtag, xdate, xforce, local, xbuild, xaflag,
|
|||||||
/* call the recursion processor */
|
/* call the recursion processor */
|
||||||
err = start_recursion (update_fileproc, update_filesdone_proc,
|
err = start_recursion (update_fileproc, update_filesdone_proc,
|
||||||
update_dirent_proc, update_dirleave_proc, NULL,
|
update_dirent_proc, update_dirleave_proc, NULL,
|
||||||
argc, argv, local, which, aflag, LOCK_READ,
|
argc, argv, local, which, aflag, CVS_LOCK_READ,
|
||||||
preload_update_dir, 1);
|
preload_update_dir, 1);
|
||||||
|
|
||||||
#ifdef SERVER_SUPPORT
|
#ifdef SERVER_SUPPORT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user