Checked in some code improvements and minor fixes that I discovered in the

FreeBSD ports system.
This commit is contained in:
Dan Fandrich 2008-09-10 20:05:45 +00:00
parent fce9c3a9f1
commit 6cea51585f
5 changed files with 15 additions and 10 deletions

View File

@ -10,8 +10,8 @@ Daniel Fandrich (9 Sep 2008)
- Mike Revi discovered some swapped speed switches documented in the curl man
page.
- Checked in some grammatical and minor other fixes in the documentation and
examples that I found in the FreeBSD ports system.
- Checked in some documentation and code improvements and fixes that I
discovered in the FreeBSD ports system.
Daniel Stenberg (8 Sep 2008)
- Dmitry Kurochkin patched a problem: I have found bug in pipelining through

View File

@ -163,10 +163,10 @@ m4_defun([AC_LIBTOOL_CXXCPP],[true])
m4_ifdef([AC_LIBTOOL_F77], [m4_undefine([AC_LIBTOOL_F77])])
m4_defun([AC_LIBTOOL_F77],[])
dnl force libtool to build static libraries with PIC on AMD64-linux
AC_MSG_CHECKING([if arch-OS host is AMD64-linux (to build static libraries with PIC)])
dnl force libtool to build static libraries with PIC on AMD64-Linux & FreeBSD
AC_MSG_CHECKING([if arch-OS host is AMD64-Linux/FreeBSD (to build static libraries with PIC)])
case $host in
x86_64*linux*)
x86_64*linux*|amd64*freebsd*|ia64*freebsd*)
AC_MSG_RESULT([yes])
with_pic=yes
;;
@ -247,7 +247,7 @@ dnl **********************************************************************
case $host in
#
x86_64*linux*)
x86_64*linux*|amd64*freebsd*|ia64*freebsd*)
#
dnl find out if icc is being used
if test "z$ICC" = "z"; then

View File

@ -347,7 +347,7 @@ static CURLcode file_upload(struct connectdata *conn)
/* treat the negative resume offset value as the case of "-" */
if(data->state.resume_from < 0) {
if(stat(file->path, &file_stat)) {
if(fstat(fileno(fp), &file_stat)) {
fclose(fp);
failf(data, "Can't get the size of %s", file->path);
return CURLE_WRITE_ERROR;

View File

@ -321,7 +321,7 @@ static size_t fd_key_compare(void*k1, size_t k1_len, void*k2, size_t k2_len)
{
(void) k1_len; (void) k2_len;
return ((*((int* ) k1)) == (*((int* ) k2))) ? 1 : 0;
return (*((int* ) k1)) == (*((int* ) k2));
}
static size_t hash_fd(void* key, size_t key_length, size_t slots_num)

View File

@ -4403,7 +4403,7 @@ operate(struct Configurable *config, int argc, argv_item_t argv[])
*/
infd= open(uploadfile, O_RDONLY | O_BINARY);
if ((infd == -1) || stat(uploadfile, &fileinfo)) {
if ((infd == -1) || fstat(infd, &fileinfo)) {
helpf(config->errors, "Can't open '%s'!\n", uploadfile);
if(infd != -1)
close(infd);
@ -5374,11 +5374,16 @@ rename_if_dos_device_name (char *file_name)
char fname[PATH_MAX];
strncpy(fname, file_name, PATH_MAX-1);
fname[PATH_MAX-2] = 0; /* Leave room for an extra _ */
fname[PATH_MAX-1] = 0;
base = basename (fname);
if (((stat(base, &st_buf)) == 0) && (S_ISCHR(st_buf.st_mode))) {
size_t blen = strlen (base);
if (strlen(fname) >= PATH_MAX-1) {
/* Make room for the '_' */
blen--;
base[blen] = 0;
}
/* Prepend a '_'. */
memmove (base + 1, base, blen + 1);
base[0] = '_';