Re: [PATCH] fdisk: when generating a DOS disk label, give it an ID

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 06, 2007 at 06:32:31PM -0700, H. Peter Anvin wrote:
> Newer Micro$oft operating systems (NT 3 and later) put a 4-byte
> signature in the MBR at offset 440 decimal.  Generate a random such
> signature when creating a new disk label, and allow it to be changed.

 Applied, thanks.

    fdisk.c: In function ‘get_random_id’:
    fdisk.c:160: warning: implicit declaration of function ‘time’
    fdisk.c: In function ‘create_doslabel’:
    fdisk.c:803: warning: unused variable ‘i’

 fixed ;-)


 BTW, I've read libparted code and there is:

        static inline uint32_t generate_random_id()
        {
            struct timeval tv;
            int rc;
            rc = gettimeofday(&tv, NULL);
            if (rc == -1)
                return 0;
            return (uint32_t)(tv.tv_usec & 0xFFFFFFFFUL);
        }


     Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
-
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux