Menu

#92 Sleep Now and Stand By Now.

v1.0 (example)
closed-works-for-me
nobody
None
5
2022-10-23
2022-10-23
Beren Scott
No

So, I've been going through the code for awhile now. And something has been bugging me.

In hdparm.c line 3487

                case     SET_FLAG('y',standbynow);
                case     SET_FLAG('Y',sleepnow);

And,

    if (set_standbynow) {
        __u8 args1[4] = {ATA_OP_STANDBYNOW1,0,0,0};
        __u8 args2[4] = {ATA_OP_STANDBYNOW2,0,0,0};
        if (get_standbynow)
            printf(" issuing standby command\n");
        if (do_drive_cmd(fd, args1, 0) && do_drive_cmd(fd, args2, 0)) {
            err = errno;
            perror(" HDIO_DRIVE_CMD(standby) failed");
        }
    }

        }
    if (set_sleepnow) {
        __u8 args1[4] = {ATA_OP_SLEEPNOW1,0,0,0};
        __u8 args2[4] = {ATA_OP_SLEEPNOW2,0,0,0};
        if (get_sleepnow)
            printf(" issuing sleep command\n");
        if (do_drive_cmd(fd, args1, 0) && do_drive_cmd(fd, args2, 0)) {
            err = errno;
            perror(" HDIO_DRIVE_CMD(sleep) failed");
        }
    }

The use of Y or y as an argument does absolutely nothing. It's a dead reference?

At the start, both are set to 0 and the argument fails to alter that state.

Discussion

  • Mark Lord

    Mark Lord - 2022-10-23

    I have no idea what you are asking. Both '-y' and '-Y' work as intended for me -- I use them regularly, and one can even verify them by using '-C' afterward to read back the (new) drive state.

     
  • Mark Lord

    Mark Lord - 2022-10-23
    • status: open --> closed-works-for-me
     
  • Mark Lord

    Mark Lord - 2022-10-23

    I have no idea what you are asking. Both '-y' and '-Y' work as intended for me -- I use them regularly, and one can even verify them by using '-C' afterward to read back the (new) drive state.

     

Log in to post a comment.

MongoDB Logo MongoDB