From d8e580a239ab84fbe063b2f3779d417598d5ca0a Mon Sep 17 00:00:00 2001 From: erik Date: Wed, 10 Jan 2007 17:27:56 +0000 Subject: BUG: The case statement was using err to figure out what to say about why sendfile didn't work. Since err is only the return value of sendfile this meant that it never reported the right thing because it can only be -1 at this point. What the author probably wanted to do was look at errno since that is what the man page says will have the real error info. FIX: Switch the case statement to use errno. --- (limited to 'noncore/apps') diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index 9181810..3986b1f 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp @@ -582,7 +582,7 @@ bool AdvancedFm::copyFile( const QString & src, const QString & dest ) { err = sendfile(write_fd, read_fd, &offset, stat_buf.st_size); if( err == -1) { QString msg; - switch(err) { + switch(errno) { case EBADF : msg = "The input file was not opened for reading or the output file was not opened for writing. "; case EINVAL: msg = "Descriptor is not valid or locked. "; case ENOMEM: msg = "Insufficient memory to read from in_fd."; -- cgit v0.9.0.2