summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTing-Wei Lan <lantw44@gmail.com>2013-08-01 17:20:30 +0800
committerLAN-TW <lantw44@gmail.com>2013-08-01 17:20:30 +0800
commit2d9f2828529eca13951212ce3ddd7d3e1034d94f (patch)
tree273f71b653bf94f49f7332e83029329f7ff3ed00
parenta255f4ec39a7fd18ab91ad996dc29b0aa35b0deb (diff)
downloadgsoc2013-libgnome-autoar-2d9f2828529eca13951212ce3ddd7d3e1034d94f.tar
gsoc2013-libgnome-autoar-2d9f2828529eca13951212ce3ddd7d3e1034d94f.tar.gz
gsoc2013-libgnome-autoar-2d9f2828529eca13951212ce3ddd7d3e1034d94f.tar.bz2
gsoc2013-libgnome-autoar-2d9f2828529eca13951212ce3ddd7d3e1034d94f.tar.lz
gsoc2013-libgnome-autoar-2d9f2828529eca13951212ce3ddd7d3e1034d94f.tar.xz
gsoc2013-libgnome-autoar-2d9f2828529eca13951212ce3ddd7d3e1034d94f.tar.zst
gsoc2013-libgnome-autoar-2d9f2828529eca13951212ce3ddd7d3e1034d94f.zip
Fix file type error for block devices
-rw-r--r--gnome-autoar/autoar-create.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gnome-autoar/autoar-create.c b/gnome-autoar/autoar-create.c
index 9a51240..c65c0eb 100644
--- a/gnome-autoar/autoar-create.c
+++ b/gnome-autoar/autoar-create.c
@@ -553,16 +553,16 @@ autoar_create_do_add_to_archive (AutoarCreate *arcreate,
#ifdef HAVE_STAT
local_pathname = g_file_get_path (file);
if (local_pathname != NULL && stat (local_pathname, &filestat) >= 0) {
- if (filestat.st_mode & S_IFSOCK) {
- g_debug ("autoar_create_do_add_to_archive: file type set to SOCKET");
- archive_entry_set_filetype (entry, AE_IFSOCK);
- } else if (filestat.st_mode & S_IFBLK) {
+ if (S_ISBLK (filestat.st_mode)) {
g_debug ("autoar_create_do_add_to_archive: file type set to BLOCK");
archive_entry_set_filetype (entry, AE_IFBLK);
- } else if (filestat.st_mode & S_IFCHR) {
+ } else if (S_ISSOCK (filestat.st_mode)) {
+ g_debug ("autoar_create_do_add_to_archive: file type set to SOCKET");
+ archive_entry_set_filetype (entry, AE_IFSOCK);
+ } else if (S_ISCHR (filestat.st_mode)) {
g_debug ("autoar_create_do_add_to_archive: file type set to CHAR");
archive_entry_set_filetype (entry, AE_IFCHR);
- } else if (filestat.st_mode & S_IFIFO) {
+ } else if (S_ISFIFO (filestat.st_mode)) {
g_debug ("autoar_create_do_add_to_archive: file type set to FIFO");
archive_entry_set_filetype (entry, AE_IFIFO);
} else {