~brian-murray/ubuntu/oneiric/apt/block-fsys-tarfile

« back to all changes in this revision

Viewing changes to apt-pkg/contrib/cdromutl.cc

  • Committer: Michael Vogt
  • Date: 2011-06-28 21:41:29 UTC
  • mfrom: (1327.97.34 debian-sid)
  • Revision ID: michael.vogt@ubuntu.com-20110628214129-tait7qp81nvm7wjv
mergedĀ fromĀ debian-sid

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#include <apti18n.h>
21
21
    
22
22
#include <sys/wait.h>
23
 
#include <sys/errno.h>
24
23
#include <sys/statvfs.h>
25
24
#include <dirent.h>
26
25
#include <fcntl.h>
206
205
      Hash.Add(Dir->d_name);
207
206
   };
208
207
   
209
 
   if (chdir(StartDir.c_str()) != 0)
210
 
      return _error->Errno("chdir",_("Unable to change to %s"),StartDir.c_str());
 
208
   if (chdir(StartDir.c_str()) != 0) {
 
209
      _error->Errno("chdir",_("Unable to change to %s"),StartDir.c_str());
 
210
      closedir(D);
 
211
      return false;
 
212
   }
211
213
   closedir(D);
212
214
   
213
215
   // Some stats from the fsys
236
238
}
237
239
                                                                        /*}}}*/
238
240
 
239
 
// FindMountPointForDevice - Find mountpoint for the given device      /*{{{*/
 
241
// FindMountPointForDevice - Find mountpoint for the given device       /*{{{*/
240
242
string FindMountPointForDevice(const char *devnode)
241
243
{
242
244
   char buf[255];
254
256
         while ( fgets(buf, sizeof(buf), f) != NULL) {
255
257
            if (strncmp(buf, devnode, strlen(devnode)) == 0) {
256
258
               if(TokSplitString(' ', buf, out, 10))
 
259
               {
 
260
                  fclose(f);
257
261
                  return string(out[1]);
 
262
               }
258
263
            }
259
264
         }
260
265
         fclose(f);
263
268
   
264
269
   return string();
265
270
}
266
 
 
267
 
 
 
271
                                                                        /*}}}*/