C code to toggle usr LEDs

For any other BeagleBoard beginners out there, here is a C program to toggle the usr LEDs, adapted from/inspired by this discussion:

http://groups.google.com/group/beagleboard/browse_thread/thread/db4accfabf02d986/872c61d84ea5a1a1

/*
  * Toggles the usr1 LED once/second on the BeagleBoard.
  * In the /sys/class/leds/beagleboard::usr1 directory, the brightness file controls usr1.
  * To turn the LED on, write "1" to the file.
  * To turn the LED off, write "0" to the file.
  * To do the same for usr0, replace beagleboard::usr1 with beagleboard::usr0.
  */

#include <string.h>
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char** argv)
{
     FILE *led_control;
     char led_value[2] = "0";

     printf("Blinking usr1 LED.\n");
     printf("Press CTRL+C to end.\n");

     while(1)
     {
         if ((led_control = fopen("/sys/class/leds/beagleboard::usr1/brightness", "r+")) == NULL)
         {
             printf("Can't open brightness file.\n");
             exit(1);
         }

         if (strcmp(led_value, "0") == 0)
         {
              strcpy(led_value, "1");
         }
         else
         {
              strcpy(led_value, "0");
         }

         fwrite(&led_value, sizeof(char), 1, led_control);
         fclose(led_control);
         sleep(1);
     }
     return 0;
}