Checked in some code improvements and minor fixes that I discovered in the
FreeBSD ports system.
This commit is contained in:
Родитель
fce9c3a9f1
Коммит
6cea51585f
4
CHANGES
4
CHANGES
|
@ -10,8 +10,8 @@ Daniel Fandrich (9 Sep 2008)
|
||||||
- Mike Revi discovered some swapped speed switches documented in the curl man
|
- Mike Revi discovered some swapped speed switches documented in the curl man
|
||||||
page.
|
page.
|
||||||
|
|
||||||
- Checked in some grammatical and minor other fixes in the documentation and
|
- Checked in some documentation and code improvements and fixes that I
|
||||||
examples that I found in the FreeBSD ports system.
|
discovered in the FreeBSD ports system.
|
||||||
|
|
||||||
Daniel Stenberg (8 Sep 2008)
|
Daniel Stenberg (8 Sep 2008)
|
||||||
- Dmitry Kurochkin patched a problem: I have found bug in pipelining through
|
- Dmitry Kurochkin patched a problem: I have found bug in pipelining through
|
||||||
|
|
|
@ -163,10 +163,10 @@ m4_defun([AC_LIBTOOL_CXXCPP],[true])
|
||||||
m4_ifdef([AC_LIBTOOL_F77], [m4_undefine([AC_LIBTOOL_F77])])
|
m4_ifdef([AC_LIBTOOL_F77], [m4_undefine([AC_LIBTOOL_F77])])
|
||||||
m4_defun([AC_LIBTOOL_F77],[])
|
m4_defun([AC_LIBTOOL_F77],[])
|
||||||
|
|
||||||
dnl force libtool to build static libraries with PIC on AMD64-linux
|
dnl force libtool to build static libraries with PIC on AMD64-Linux & FreeBSD
|
||||||
AC_MSG_CHECKING([if arch-OS host is AMD64-linux (to build static libraries with PIC)])
|
AC_MSG_CHECKING([if arch-OS host is AMD64-Linux/FreeBSD (to build static libraries with PIC)])
|
||||||
case $host in
|
case $host in
|
||||||
x86_64*linux*)
|
x86_64*linux*|amd64*freebsd*|ia64*freebsd*)
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
with_pic=yes
|
with_pic=yes
|
||||||
;;
|
;;
|
||||||
|
@ -247,7 +247,7 @@ dnl **********************************************************************
|
||||||
|
|
||||||
case $host in
|
case $host in
|
||||||
#
|
#
|
||||||
x86_64*linux*)
|
x86_64*linux*|amd64*freebsd*|ia64*freebsd*)
|
||||||
#
|
#
|
||||||
dnl find out if icc is being used
|
dnl find out if icc is being used
|
||||||
if test "z$ICC" = "z"; then
|
if test "z$ICC" = "z"; then
|
||||||
|
|
|
@ -347,7 +347,7 @@ static CURLcode file_upload(struct connectdata *conn)
|
||||||
|
|
||||||
/* treat the negative resume offset value as the case of "-" */
|
/* treat the negative resume offset value as the case of "-" */
|
||||||
if(data->state.resume_from < 0) {
|
if(data->state.resume_from < 0) {
|
||||||
if(stat(file->path, &file_stat)) {
|
if(fstat(fileno(fp), &file_stat)) {
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
failf(data, "Can't get the size of %s", file->path);
|
failf(data, "Can't get the size of %s", file->path);
|
||||||
return CURLE_WRITE_ERROR;
|
return CURLE_WRITE_ERROR;
|
||||||
|
|
|
@ -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;
|
(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)
|
static size_t hash_fd(void* key, size_t key_length, size_t slots_num)
|
||||||
|
|
|
@ -4403,7 +4403,7 @@ operate(struct Configurable *config, int argc, argv_item_t argv[])
|
||||||
*/
|
*/
|
||||||
|
|
||||||
infd= open(uploadfile, O_RDONLY | O_BINARY);
|
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);
|
helpf(config->errors, "Can't open '%s'!\n", uploadfile);
|
||||||
if(infd != -1)
|
if(infd != -1)
|
||||||
close(infd);
|
close(infd);
|
||||||
|
@ -5374,11 +5374,16 @@ rename_if_dos_device_name (char *file_name)
|
||||||
char fname[PATH_MAX];
|
char fname[PATH_MAX];
|
||||||
|
|
||||||
strncpy(fname, file_name, PATH_MAX-1);
|
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);
|
base = basename (fname);
|
||||||
if (((stat(base, &st_buf)) == 0) && (S_ISCHR(st_buf.st_mode))) {
|
if (((stat(base, &st_buf)) == 0) && (S_ISCHR(st_buf.st_mode))) {
|
||||||
size_t blen = strlen (base);
|
size_t blen = strlen (base);
|
||||||
|
|
||||||
|
if (strlen(fname) >= PATH_MAX-1) {
|
||||||
|
/* Make room for the '_' */
|
||||||
|
blen--;
|
||||||
|
base[blen] = 0;
|
||||||
|
}
|
||||||
/* Prepend a '_'. */
|
/* Prepend a '_'. */
|
||||||
memmove (base + 1, base, blen + 1);
|
memmove (base + 1, base, blen + 1);
|
||||||
base[0] = '_';
|
base[0] = '_';
|
||||||
|
|
Загрузка…
Ссылка в новой задаче