Hi,

Please find attached the patch for umount02 and umount03 issue.


Regards,
rohit


---------- Forwarded message ----------
From: CAI Qian <[email protected]>
Date: Tue, May 12, 2009 at 1:15 AM
Subject: Re: [LTP] umount02 and umount03 issue.
To: [email protected]


From: rohit verma <[email protected]>
Subject: Re: [LTP] umount02 and umount03 issue.
Date: Tue, 12 May 2009 12:32:09 +0530

> Hi,
>
> Attached is the patch that consists old modifications and those
> suggested by you.. Hope the indentations are right this time.
>
> Verify the same... And, let me know about it...
>
> Regards,
> rohit

It works well. Please submit it with my ACK to the mailing list for
inclusion.

Acked-by: CAI Qian <[email protected]>

Thanks,
CAI Qian
diff -ruxB ltp-full-20090331_orig/testcases/kernel/syscalls/umount/umount02.c 
ltp-full-20090331/testcases/kernel/syscalls/umount/umount02.c
--- ltp-full-20090331_orig/testcases/kernel/syscalls/umount/umount02.c  
2009-03-23 19:06:13.000000000 +0530
+++ ltp-full-20090331/testcases/kernel/syscalls/umount/umount02.c       
2009-05-12 12:04:22.000000000 +0530
@@ -171,9 +171,9 @@
        if (Tflag == 1) {
                strncpy(Type, fstype,
                        (FSTYPE_LEN <
-                        strlen(fstype)) ? FSTYPE_LEN : strlen(fstype));
+                        (strlen(fstype)+1)) ? FSTYPE_LEN : (strlen(fstype)+1));
        } else {
-               strncpy(Type, DEFAULT_FSTYPE, strlen(DEFAULT_FSTYPE));
+               strncpy(Type, DEFAULT_FSTYPE, strlen(DEFAULT_FSTYPE)+1);
        }
 
        if (STD_COPIES != 1) {
@@ -252,12 +252,17 @@
        switch (i) {
        case 0:
                /* Setup for umount(2) returning errno EBUSY. */
+               if(access(Device,F_OK)) {
+                       tst_brkm(TBROK, cleanup,
+                               "Device %s does not exist", Device);
+                       return 1;
+               }
 
                TEST(mount(Device, Mntpoint, Fstype, Flag, NULL));
 
                if (TEST_RETURN == -1) {
                        tst_brkm(TBROK, cleanup, "mount(2) failed to mount "
-                                "device %s at mountpoint %s, Got errno - %s :"
+                                "device %s at mountpoint %s, Got errno - %d :"
                                 " %s", Device, Mntpoint, TEST_ERRNO,
                                 strerror(TEST_ERRNO));
                        return 1;
diff -ruxB ltp-full-20090331_orig/testcases/kernel/syscalls/umount/umount03.c 
ltp-full-20090331/testcases/kernel/syscalls/umount/umount03.c
--- ltp-full-20090331_orig/testcases/kernel/syscalls/umount/umount03.c  
2009-03-23 19:06:13.000000000 +0530
+++ ltp-full-20090331/testcases/kernel/syscalls/umount/umount03.c       
2009-05-12 12:11:50.000000000 +0530
@@ -149,9 +149,9 @@
        if (Tflag == 1) {
                strncpy(Type, fstype,
                        (FSTYPE_LEN <
-                        strlen(fstype)) ? FSTYPE_LEN : strlen(fstype));
+                        (strlen(fstype)+1)) ? FSTYPE_LEN : (strlen(fstype)+1));
        } else {
-               strncpy(Type, DEFAULT_FSTYPE, strlen(DEFAULT_FSTYPE));
+               strncpy(Type, DEFAULT_FSTYPE, strlen(DEFAULT_FSTYPE)+1);
        }
 
        if (STD_COPIES != 1) {
@@ -273,6 +273,11 @@
        /* set up expected error numbers */
        TEST_EXP_ENOS(exp_enos);
 
+       if(access(device,F_OK)) {
+               tst_brkm(TBROK, cleanup1,
+                       "Device '%s' does not exist", device);
+       }
+
        TEST(mount(device, mntpoint, Type, 0, NULL));
 
        if (TEST_RETURN != 0) {
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to