From d80239d6233f0a35e25da93aea23af2ceb5b3ed5 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 8 Mar 2006 21:51:50 +0000 Subject: [PATCH] Remove old code from findlib/create_file.c git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2829 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/kes-1.39 | 1 + bacula/src/findlib/create_file.c | 70 +------------------------------- 2 files changed, 2 insertions(+), 69 deletions(-) diff --git a/bacula/kes-1.39 b/bacula/kes-1.39 index b2c99eb8bb..5da536694b 100644 --- a/bacula/kes-1.39 +++ b/bacula/kes-1.39 @@ -3,6 +3,7 @@ General: 08Mar06 +- Remove old code from findlib/create_file.c - Rename mac.c migrate.c - Add user friendly display of VolBytes in job report. - Rename target... to previous... to make it a bit easier to diff --git a/bacula/src/findlib/create_file.c b/bacula/src/findlib/create_file.c index 4e4312f713..56b2df9298 100644 --- a/bacula/src/findlib/create_file.c +++ b/bacula/src/findlib/create_file.c @@ -185,76 +185,8 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) attr->ofname, be.strerror()); return CF_ERROR; } - - /* this doesn't solve the Microsoft problem - Thorsten Engel - so I reused the code of V 1.40 - /* - * If the open fails, we attempt to cd into the directory - * and create the file with a relative path rather than - * the full absolute path. This is for Win32 where - * path names may be too long to create. - */ - /* - if ((bopen(bfd, attr->ofname, mode, S_IRUSR | S_IWUSR)) < 0) { - berrno be; - int stat; - Dmsg2(000, "bopen failed errno=%d: ERR=%s\n", bfd->berrno, - be.strerror(bfd->berrno)); - if (strlen(attr->ofname) > 250) { // Microsoft limitation - char savechr; - char *p, *e; - struct saved_cwd cwd; - savechr = attr->ofname[pnl]; - attr->ofname[pnl] = 0; // terminate path - Dmsg1(000, "Do chdir %s\n", attr->ofname); - if (save_cwd(&cwd) != 0) { - Qmsg0(jcr, M_ERROR, 0, _("Could not save_dirn")); - attr->ofname[pnl] = savechr; - return CF_ERROR; - } - p = attr->ofname; - while ((e = strchr(p, '/'))) { - *e = 0; - if (chdir(p) < 0) { - berrno be; - Qmsg2(jcr, M_ERROR, 0, _("Could not chdir to %s: ERR=%s\n"), - attr->ofname, be.strerror()); - restore_cwd(&cwd, NULL, NULL); - free_cwd(&cwd); - attr->ofname[pnl] = savechr; - *e = '/'; - return CF_ERROR; - } - *e = '/'; - p = e + 1; - } - if (chdir(p) < 0) { - berrno be; - Qmsg2(jcr, M_ERROR, 0, _("Could not chdir to %s: ERR=%s\n"), - attr->ofname, be.strerror()); - restore_cwd(&cwd, NULL, NULL); - free_cwd(&cwd); - attr->ofname[pnl] = savechr; - return CF_ERROR; - } - attr->ofname[pnl] = savechr; - Dmsg1(000, "Do open %s\n", &attr->ofname[pnl+1]); - if ((bopen(bfd, &attr->ofname[pnl+1], mode, S_IRUSR | S_IWUSR)) < 0) { - stat = CF_ERROR; - } else { - stat = CF_EXTRACT; - } - restore_cwd(&cwd, NULL, NULL); - free_cwd(&cwd); - if (stat == CF_EXTRACT) { - return CF_EXTRACT; - } - } - Qmsg2(jcr, M_ERROR, 0, _("Could not create %s: ERR=%s\n"), - attr->ofname, be.strerror(bfd->berrno)); - return CF_ERROR; - }*/ return CF_EXTRACT; + #ifndef HAVE_WIN32 // none of these exists on MS Windows case FT_RAW: /* Bacula raw device e.g. /dev/sda1 */ case FT_FIFO: /* Bacula fifo to save data */ -- 2.39.5